6.UIAlertView的基本使用
2016-01-07 15:08
411 查看
1.输入文字的alertView
alertView 可以选择样式,有弹出让用户输入文字的样式以及怎么获得alertView上的UITextField:UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"修改数据" message:nil delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; alert.alertViewStyle = UIAlertViewStylePlainTextInput; UITextField *textField = [alert textFieldAtIndex:0]; //textField.text =hero.name; textField.placeholder=hero.name; [alert show];
通过代理拿到文字
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ UITextField *textField = [alertView textFieldAtIndex:0]; NSString *newStr = textField.text; }
相关文章推荐
- Listview最后一行被覆盖的bug
- easyui datagrid 分页保持checkbox选中状态
- easyui-tab href,content区别
- build.xml:278: Unable to find a javac compiler;
- NSInteger、NSUInteger、CGFloat
- Scapy + Nfqueue
- iOS - UITextField代理方法详解(调用顺序)
- 聊聊iterable,sequence和iterators
- 源码推荐(01.07B):MVVM登录页面,一句代码设置UILabel的行距间距
- upload.parseRequest为空
- iOS UI设计: 完美自定义tabbar (不需要额外代码即可按自带的tabbar使用方式)
- 5.UITableView基本使用
- 5.1.2. Using Lists as Queues(像队列一样)
- upload.parseRequest(request) 结果为null的一个恶心处理法
- Duilib 入门
- iOS UITableView自动滚动到底部
- MFC工程的Dui+Win32改造案例遇到的问题总结
- IOS UIAlertControl与UIAlertAction
- 关于PropertyInfo setvalue()和PropertyInfo getvalue()
- ios开发--UIImage转化成NSData