Is the opacity and alpha the same thing for UIView

trillions picture trillions · Mar 13, 2013 · Viewed 31k times · Source

I want to use animation to change UIView's color to make it fade, however, somehow i can't access and set opacity, but i can set alpha. I wonder if alpha and opacity are the same? Search on the web and I didnt find a good answer. Thanks a lot for your help!

Answer

alex picture alex · Mar 13, 2013

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.