gpt4 book ai didi

ios uibutton隐藏: does this automatically make the button disabled?

转载 作者:IT王子 更新时间:2023-10-29 08:05:25 30 4
gpt4 key购买 nike

我只是有一个关于 UIButtons/iOS 的一般知识问题。

假设您有一个 UIButton。您将“隐藏”属性设置为"is"。这使得它不再可见,对吧?但我注意到,虽然它不再可见,但也不再可点击。那么,这是否意味着设置 hidden = YES 也会设置 enabled = NO?

只是好奇。谢谢大家。

最佳答案

UIButton 和所有控件都继承了 UIView 的通用属性,如 hiddenbackgroundColor 等。

UIView 的类引用说明如果任何 View 被隐藏,那么它将不会接收输入事件

UIView 的类引用说:

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.

你可以在 Here 上找到这个.

关于ios uibutton隐藏: does this automatically make the button disabled?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17549790/

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