我没有问题在 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)
我的当前弹出窗口的文本框外形很方,看起来不太好。
我想要的是:
我拥有的是: