Mask a UIImageView with another UIImageView
Is there any way you can mask a UIImageView with the alpha of another UIImageView? I know there is a way to mask images using Quartz2D in a custom U开发者_如何学GoIView, but is there any way you can do this in a more direct way accessing just both UIImageViews separately?
ViewX contains 2 sub-views, view1 and view2. View1 has alpha=.5 and view2 has alpha=1.0. If view1 is in front of view2, you will see a semi-transparent view1 on top of a full view2.
If, on the other hand, view2 is a subview of view1, with the alpha values as above, view2 will "inherit" the .5 alpha from it's superview.
精彩评论