gpt4 book ai didi

ios - 在隐藏的 UIView 中接收触摸事件?

转载 作者:行者123 更新时间:2023-11-28 17:51:11 26 4
gpt4 key购买 nike

是否有可能以某种方式接收和响应来自不可见的 UIView 的触摸事件。我试过——以及从 Apple 文档中读到的——简单地设置“隐藏”是行不通的。我正在寻找一种替代方法来达到同样的效果。

A hidden view disappears from its window and does not receive input events. It remains in its superview’s list of subviews, however, and participates in autoresizing as usual. Hiding a view with subviews has the effect of hiding those subviews and any view descendants they might have. This effect is implicit and does not alter the hidden state of the receiver’s descendants.

最佳答案

如果 View 已将 userInteractionEnabled 设置为 YES,则它在隐藏时将是可触摸的。例如,尝试使用 UIButton 进行试验。

关于ios - 在隐藏的 UIView 中接收触摸事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35496009/

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