英文:
In iOS16.4 Email inside TextField prompt rendered blue
问题
升级到Xcode版本14.3后,在iOS 16.4中,TextField的提示文字不再是灰色,而是蓝色,而在iOS 16.3中它是灰色的
struct ContentView: View {
@State var email: String = .init()
var body: some View {
VStack {
TextField("account@email.com", text: $email)
}
.padding()
}
}
英文:
After upgrading to Xcode Version 14.3, the TextField prompt in iOS 16.4 is rendered blue not gray as it was in iOS 16.3
struct ContentView: View {
@State var email: String = .init()
var body: some View {
VStack {
TextField("account@email.com", text: $email)
}
.padding()
}
}
答案1
得分: 3
你可以尝试这个:
TextField("account@email.com", text: $email)
或者这个:
TextField("", text: $email, prompt: Text("account@email.com"))
英文:
you could try this:
TextField("\("account@email.com")", text: $email)
or this:
TextField("", text: $email, prompt: Text(verbatim: "account@email.com"))
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论