SST*_*SST 12 iphone cocoa objective-c uikit
我想通过使用UIAlertView将播放器名称作为输入.是否可以在UIAlertView上添加textField?
Tus*_*121 31
从iOS 5开始,UIAlertView提供了这个:将alertViewStyle属性更改为以下之一:
UIAlertViewStylePlainTextInput (1 text field)
UIAlertViewStyleSecureTextInput (1 password field)
UIAlertViewStyleLoginAndPasswordInput (both a text field and password field)
Run Code Online (Sandbox Code Playgroud)
然后使用textFieldAtIndex:
获取所需的文本字段.这样,您甚至可以使用alertViewShouldEnableFirstOtherButton:
委托方法来启用按钮.