UIAlertController
2015-11-12 15:20
369 查看
集成了UIAlertView和UIActionSheet的功能
通过选择风格, 可以选择上述两种样式
这里选择弹出框样式, 可以制成登陆框样式
添加按钮
//
通过选择风格, 可以选择上述两种样式
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"版本信息" message:nil preferredStyle:UIAlertControllerStyleAlert];
这里选择弹出框样式, 可以制成登陆框样式
alertController.addTextFieldWithConfigurationHandler { (textField: UITextField!) -> Void in textField.placeholder = "登录" } alertController.addTextFieldWithConfigurationHandler { (textField: UITextField!) -> Void in textField.placeholder = "密码" textField.secureTextEntry = true }
添加按钮
// UIAlertAction *cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]; UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"好的" style:UIAlertActionStyleDefault handler:nil]; // [alertController addAction:cancleAction]; [alertController addAction:okAction];
//
[self presentViewController:alertController animated:YES completion:nil];
相关文章推荐
- CYC-UITableViewCell的动态高度
- UIScrollView 的subViews的问题
- 让UITableView的section header view不悬停的方法
- ant <copy文件忽略目录结构flatten="true"
- Django中request和response中的属性方法详述
- UIView 控件
- Mac下安装使用apktool,jd-gui进行反编译
- karma+requirejs+angular 测试
- Bluemix 动手系列 (二) 通过命令行部署和更新云应用
- java web 通过前台输入的数据(name-value)保存到后台 xml文件中
- uiscrollview和uiimagevie的代理实现
- iOS中UIPickerView详解
- UIView的层次结构--code
- IOS中UIView的响应事件,属性和方法
- 自定义uitableviewcell
- 《锋利的jQruery》读书笔记
- 【笔记】媒体查询Media Querier
- easyui combobox
- BIOS设置之UEFI/Legacy BIOS切换图文详解
- Java中String和StringBuffer,StringBuilder的区别小结