gpt4 book ai didi

iphone - 我可以调出一个带有可触摸背景的 UIActionSheet 吗?

转载 作者:行者123 更新时间:2023-11-29 10:59:27 25 4
gpt4 key购买 nike

我在 UIActionSheet 上有一个 UIPickerView。现在 UIActionSheet 使 UIActionSheet 后面的 View 不可触摸。有没有办法让它可以触摸?或者这就是 UIActionSheet 的工作原理?

最佳答案

我认为如果不首先关闭它,就不可能使 UIActionSheet 背后的 View 可触摸。它们应该是模态的,即在被解雇之前需要用户的注意。

来自 UIActionSheet class reference (强调我的):

For applications running on iPhone and iPod touch devices, the action sheet typically slides up from the bottom of the window that owns the view. For applications running on iPad devices, the action sheet is typically displayed in a popover that is anchored to the starting view in an appropriate way. Taps outside of the popover automatically dismiss the action sheet, as do taps within any custom buttons. You can also dismiss it programmatically.

我想解决这个问题的方法可能是您只创建自己的显示类似的 View 。例如,创建一个 UIView,您可以在按下按钮时为其设置动画(向上滑动)。此 UIView 可以包含您的 UIPickerView 和您需要的任何其他内容(可能是取消按钮以关闭它)。

希望这对您有所帮助,祝您好运!

关于iphone - 我可以调出一个带有可触摸背景的 UIActionSheet 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16660137/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com