ios - iOS 文档中有关 UIView 的 alpha 属性的错误?

标签 ios alpha

我刚刚注意到 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/

相关文章:

C Imlib 用 alpha 混合两个图像

java - JButton alpha 背景随着鼠标悬停而改变

ios - NSPredicate 使用数组作为过滤器

ios - 如何在 iOs 中获取用户的可用性通知?

ios - B 的子类(从 A 类继承)可以从 A 的子类而不是 A 本身继承吗?

alpha - CGBitmapContextCreate 与 kCGImageAlphaNone

ios - 如何给透明的 UIView 添加阴影?

ios - 以编程方式将 iPhone 联系人导出到 .vcf 文件

iphone - 如何收集信用卡信息

javascript - 减去不透明度而不是乘以