iphone - UIAlertViewStylePlainTextInput 未声明

标签 iphone objective-c ios

当该属性应该在框架中可用时,我总是将其视为未声明。

UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Email Alert" message:@"Enter your Email Address" delegate:self cancelButtonTitle:@"Hide" otherButtonTitles:nil];
[alert setAlertViewStyle:UIAlertViewStyleSecureTextInput];
[alert show];
[alert release];

最佳答案

我以这种方式使用了 UIAlertViewStylePlainTextInput 。请根据需要修改代码。

                 alertType = @"phoneNumberAlert";
                 UIAlertView *phoneNumberAlert = [[UIAlertView    
                 alloc]initWithTitle:@"Notice"     
                 message:@"Please enter your Phone Number" delegate:self 
                 cancelButtonTitle:nil otherButtonTitles:@"Ok", nil];
                 [phoneNumberAlert setAlertViewStyle:UIAlertViewStylePlainTextInput];
                 UITextField *alertTextField = [phoneNumberAlert textFieldAtIndex:0];
                 alertTextField.keyboardType = UIKeyboardTypeNumberPad;
                 [phoneNumberAlert show];
                 [phoneNumberAlert release];

关于iphone - UIAlertViewStylePlainTextInput 未声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14160531/

相关文章:

iphone - iPod Touch 4G 认为它是 iPad

ios - 如何使 UIButton 文本对齐中心?使用 IB

ios - UIWebView URL拦截

ios - 如何从 ARKit 相机获取外部矩阵?

ios - 通过另一个类以编程方式将对象添加到 xib 文件

ios - 带有仅推送内容的导航栏的侧边菜单

iphone - 使用静态常量——内存停止?

iphone - 应用程序关闭时崩溃

objective-c - 改变实例 NSArray

ios - 在 IOS 中移动到 View Controller 时出现问题