我想等待通过警告对话框输入用户名,如何在 UIAlertView 上添加 UITextField
最佳答案
这在 iOS5 之后发生了变化。您现在可以创建具有样式的 UIAlertView。
UIAlertView 现在有一个属性 - alertViewStyle
,您可以将其设置为枚举值之一
- UIAlertViewStyleDefault
- UIAlertViewStyleSecureTextInput
- UIAlertViewStylePlainTextInput
- UIAlertViewStyleLoginAndPasswordInput
创建警报 View 后,您可以设置它的样式并显示它。解除警报后,您可以使用警报 View 的 textFieldAtIndex:
属性访问字段的内容。
关于iphone - objective-c,如何在 UIAlertView 上添加 UITextField,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5481182/