我刚刚注意到 UIView 的类引用中有些奇怪的地方。在 alpha 下它指出:
This value affects only the current view and does not affect any of its embedded subviews.
但您肯定知道,事实并非如此。如果您更改父 View 的 alpha,所有 subview 也会应用新的 alpha。
是文档有误还是我误解了?
最佳答案
This value affects only the current view and does not affect any of its embedded subviews.
我的理解是:
Changing the alpha value on a view will not change the alpha value on any subviews. As in, whilst the subviews will appear to have changed their alpha, their
.alpha
property value will not change when the superview's.alpha
is changed.
关于ios - iOS 文档中有关 UIView 的 alpha 属性的错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13067296/