[TwistedFate]UIAlertView
来源:互联网 发布:java入门代码例子 编辑:程序博客网 时间:2024/06/08 10:27
AlertView
初始化
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"确定删除?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
添加button
[alert addButtonWithTitle:@"注册"];
修改标题
alert.title = @"通知";
在弹窗中添加TextField
[alert setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput]; UITextField *text1 = [alert textFieldAtIndex:0]; UITextField *text2 = [alert textFieldAtIndex:1]; text1.keyboardType = UIKeyboardTypeNamePhonePad; text2.keyboardType = UIKeyboardTypeURL;
显现 弹窗alert
[alert show];
弹窗多与button连用
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(100, 100, 100, 50); button.backgroundColor = [UIColor redColor]; [button setTitle:@"打开" forState:UIControlStateNormal]; [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside]; [self.window addSubview:button];
- (IBAction)buttonPressed:(UIButton *)button{ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"确定删除?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; //[alert addButtonWithTitle:@"注册"]; alert.title = @"hah "; //alert.delegate = self; [alert setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput]; UITextField *text1 = [alert textFieldAtIndex:0]; UITextField *text2 = [alert textFieldAtIndex:1]; text1.keyboardType = UIKeyboardTypeNamePhonePad; text2.keyboardType = UIKeyboardTypeURL; [alert show]; // [self.window addSubview:alert]; [alert release]; // NSLog(@"%d",alert.visible);}- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ NSLog(@"%ld",buttonIndex);}
0 0
- [TwistedFate]UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIalertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- spring下配置dbcp,c3p0,proxool
- Spring中bean的生命周期
- 常用工具下载地址
- 分支结构
- delphi Stomp客户端连接 RabbitMQ(1)
- [TwistedFate]UIAlertView
- 修改linux shell当前路径长度
- 【大话GSM】MS如何进行FCH、SCH和BCCH的分析及获取
- hdoj 5194 DZY Loves Balls
- jquery 自制广告轮播小插件
- android中加载大图片到内存
- Ubuntu 12.04 安装eclipse for c++
- java 中的StringBuilder和StringBuffer
- C++面向对象高级开发_极客班_第一节课笔记_section2