目前,我正在使用一个 UI,需要单击按钮,当按钮 alpha 为 1 时,当我将其更改为 0 时,它可以正常工作,但我无法获取按钮触摸事件? 有什么理由吗?
最佳答案
To hide a view visually, you can either set its hidden property to YES or change its alpha property to 0.0. A hidden view does not receive touch events from the system. However, hidden views do participate in autoresizing and other layout operations associated with the view hierarchy. Thus, hiding a view is often a convenient alternative to removing views from your view hierarchy, especially if you plan to show the views again at some point soon.
关于ios - 按钮点击事件不触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43980844/