在iOS 16.4中,TextField内的Email提示文字呈蓝色渲染。

huangapple go评论72阅读模式
英文:

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"))

huangapple
  • 本文由 发表于 2023年3月31日 21:35:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/75899171.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定