效果图
![](https://img.haomeiwen.com/i6169789/f5785772c8ef8428.png)
代码
struct ContentView : View {
@State private var password = ""
var body: some View {
VStack{
SecureField("密码框1", text: $password)
SecureField("密码框2", text: $password) {
print("Your username is \(self.password)!")
}
.textFieldStyle(RoundedBorderTextFieldStyle())
}
.padding()
}
}
网友评论