【发布时间】:2015-01-09 12:42:16
【问题描述】:
向 UIAlertController 添加文本字段没有问题,但我发现这些文本字段很可怕。有谁知道如何让他们更有吸引力?
我添加文本字段的代码:
let pincodeAlert:UIAlertController = UIAlertController(title: alertTitle, message: "Enter your passcode", preferredStyle: UIAlertControllerStyle.Alert)
pincodeAlert.addTextFieldWithConfigurationHandler({ (pinCodeTextField:UITextField!) -> Void in
pinCodeTextField.placeholder = "Password"
pinCodeTextField.secureTextEntry = true
pincodeAlert.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel, handler: nil}))
pincodeAlert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: { (action) -> Void in
//do some other stuff here...
}))
presentViewController(pincodeAlert, animated: true, completion: nil)
我当前的警报视图的文本字段非常方正,看起来不太好。
我想要什么:
我有什么:
【问题讨论】:
-
我猜它是 sdk 中的一个错误。也许您可以创建自定义警报视图?
-
你有没有想过这个问题?我面临着类似的问题。
-
不,我没有,我正在考虑使用自定义视图。
标签: swift ios8 xcode6 uialertview