IOS开发:UIAlertView使用
UIAlertView是什么就不介绍了
1.基本用法
1 UIAlertView *view = [[UIAlertView alloc]initWithTitle:@"Test" //标题
2 message:@"this is a alert view " //显示内容
3 delegate:nil //委托,可以点击事件进行处理
4 cancelButtonTitle:@"取消"
5 otherButtonTitles:@"确定"
6 //,@"其他", //添加其他按钮
7 nil];
8 [view show];效果图:
2.多个按钮
取消上面代码@“其他”的注释后,运行效果如下
可以以此类推,添加多个
3.一些系统样式参数
UIAlertViewStyle这个枚举提供了几个样式
1 typedef NS_ENUM(NSInteger, UIAlertViewStyle) {
2 UIAlertViewStyleDefault = 0, //缺省样式
3 UIAlertViewStyleSecureTextInput, //密文输入框
4 UIAlertViewStylePlainTextInput, //明文输入框
5 UIAlertViewStyleLoginAndPasswordInput //登录用输入框,有明文用户名,和密文密码输入二个输入框
6 };
使用代码如下:
1 UIAlertView *view = [[UIAlertView alloc]initWithTitle:@"请等待" //标题
2 message:@"this is a alert view " //显示内容
相关新闻>>
- 发表评论
-
- 最新评论 更多>>
今日头条
更多>>您可能感兴趣的文章
- iPhone应用开发之十一:常用的三种动画表现效果
- Lexical or Preprocessor Issue 'xxx.h
- (iPhone/iPad开发)presentViewController相应方法在SDK5.0前后
- 多线程之NSInvocationOperation
- ios学习笔记(二)xcode 4.3.2下实现基本交互
- iPhone开发学习笔记006—— NSNotification自定义通知名
- ios开发问题:添加库和复制其它工程文件编译错误问题
- iphone开发之object c基础一定义接口
- Android:实现TabWidget选项卡按钮在屏幕下方
- Memory on the iPhone