Swift下弹出对话框
发布时间:2020-12-14 01:36:24 所属栏目:百科 来源:网络整理
导读:// 对话框控制器 let alertController = UIAlertController( title : "提示" , message : "数字不能为空" , preferredStyle : UIAlertControllerStyle.Alert) // 点击按钮动作 let canCelAction = UIAlertAction (title: "取消" ,style: UIAlertActionStyle.
//对话框控制器
let alertController = UIAlertController(title: "提示",message: "数字不能为空",preferredStyle: UIAlertControllerStyle.Alert)
//点击按钮动作
let canCelAction = UIAlertAction(title: "取消",style: UIAlertActionStyle.Cancel,handler: { (UIAlertAction) -> Void in print("取消操作") }) let okAction = UIAlertAction(title: "确定",style: UIAlertActionStyle.Default,handler:nil) alertController.addAction(canCelAction) alertController.addAction(okAction) self.presentViewController(alertController,animated:true,completion:nil)
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- OpenWRT查看CPU,RAM,Flash信息参数
- c – 通过union合法访问__m128变量的字节?
- JSONObject j=JSONObject.fromObject(map) 这部分后就没反应
- 使用Dojo的 defer(延迟) 方法的基本知识
- CSR1000v XML file over KVM
- dojo中的下拉框
- Flash耗时较长的方法执行完之后再执行另一个方法 as3.0
- 关于Flashback table tablename to before drop的应用—恢复
- ruby-on-rails – 创建新的rails动作不起作用?
- cocos2d-x 3.0rc开发指南:Windows下Android环境搭建