Is the opacity and alpha the same thing for UIView [duplicate]

心不动则不痛 提交于 2019-12-03 04:43:34
alex

Actually "opacity" means "value of alpha-channel" of your UIView. When a view is fully opaque this means its alpha = 1, when a view is fully transparent (non-opaque) its alpha = 0.

As about properties of CALayer and UIView in Cocoa, yes, they provide the same functionality.

Just try by yourself!

CALayer has opacity from 0 to 1, while UIView has alpha from 0 to 1. They have the same visual effect.

Ravindhiran

Alpha affects everything drawn on the view.The background color's alpha affects the background color's transparency and anything else drawn on the view.i.e it brings about a frosty effect to whole view. Opacity means don't draw anything underneath, even if you are transparent, it just effects the current view.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!