我有这个代码,但我不知道如何在UIAlertView中显示文本字段.
var altMessage = UIAlertController(title: "Warning", message: "This is Alert Message", preferredStyle: UIAlertControllerStyle.Alert)
altMessage.addAction(UIAlertAction(title: "Done", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(altMessage, animated: true, completion: nil)
我有textfield的代码,如何在UIAlerView中显示
var my:UITextField = UITextField(frame: CGRectMake(0, 0, 10, 10))
我还try 了以下代码:
var alert = UIAlertView()
alert.title = "Enter Input"
alert.addButtonWithTitle("Done")
alert.alertViewStyle = UIAlertViewStyle.PlainTextInput
alert.addButtonWithTitle("Cancel")
alert.show()
当我指定AlertStyle纯文本时,它会显示一个带有默认占位符"Login"的文本字段..我想改变这一点,我想展示一个十进制键盘.我还想处理用户在文本字段中输入的值.有人能帮我吗?