UIActionsheet不显示运行iOS7的iPad上的所有按钮

UIActionsheet不显示运行iOS7的iPad上的所有按钮,第1张

概述UIActionSheet的实例无法在运行iOS7的iPad上正确显示.出于某种原因,他们会显示取消按钮并取消最后一个按钮.相同的代码在iOS8上运行正常. 如果点击屏幕上的其他位置将关闭 *** 作表,您可能会忽略取消按钮.有谁知道为什么会这样? 两种情况都使用完全相同的代码: // Create UIActionSheet let mapOptions = UIActionSheet(titl UIActionSheet的实例无法在运行iOS7的iPad上正确显示.出于某种原因,他们会显示取消按钮并取消最后一个按钮.相同的代码在iOS8上运行正常.

如果点击屏幕上的其他位置将关闭 *** 作表,您可能会忽略取消按钮.有谁知道为什么会这样?

两种情况都使用完全相同的代码:

// 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上的所有按钮所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1077277.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-26
下一篇2022-05-26

发表评论

登录后才能评论

评论列表(0条)

    保存