
如果点击屏幕上的其他位置将关闭 *** 作表,您可能会忽略取消按钮.有谁知道为什么会这样?
两种情况都使用完全相同的代码:
// Create UIActionSheet let mapOptions = UIActionSheet(Title: "Select map type",delegate: self,cancelbuttonTitle: "Cancel",destructivebuttonTitle: nil,otherbuttonTitles: "Standard","HybrID","Satellite")// display from bar buttonmapOptions.showFrombarbuttonItem(self.mapTypebutton,animated: true)解决方法 我能够通过避免默认的UIActionSheet构造函数并单独添加按钮来解决问题.这 – 并确保最后添加取消按钮 – 解决了问题.
// Create the UIActionSheetvar mapOptions = UIActionSheet()mapOptions.Title = "Select map type"mapOptions.addbuttonWithTitle("Standard")mapOptions.addbuttonWithTitle("HybrID")mapOptions.addbuttonWithTitle("Satellite")// Add a cancel button,and set the button index at the same timemapOptions.cancelbuttonIndex = mapOptions.addbuttonWithTitle("Cancel")mapOptions.delegate = self// display the action sheetmapOptions.showFrombarbuttonItem(self.mapTypebutton,animated: true) 总结 以上是内存溢出为你收集整理的UIActionsheet不显示运行iOS7的iPad上的所有按钮全部内容,希望文章能够帮你解决UIActionsheet不显示运行iOS7的iPad上的所有按钮所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)