升级到 Xcode 14.3 版本后,iOS 16.4 中的 TextField 提示呈现为蓝色,而不是像 iOS 16.3 中那样呈灰色
struct ContentView: View {
@State var email: String = .init()
var body: some View {
VStack {
TextField("<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f8999b9b978d968cb89d95999194d69b9795" rel="noreferrer noopener nofollow">[email protected]</a>", text: $email)
}
.padding()
}
}
最佳答案
你可以试试这个:
TextField("\("<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="452426262a302b31052028242c296b262a28" rel="noreferrer noopener nofollow">[email protected]</a>")", text: $email)
或者这个:
TextField("", text: $email, prompt: Text(verbatim: "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="abcac8c8c4dec5dfebcec6cac2c785c8c4c6" rel="noreferrer noopener nofollow">[email protected]</a>"))
关于swift - 在 iOS16.4 中 TextField 内的电子邮件提示呈现蓝色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75899171/