Reputation: 1064
I have
Now when I try to
gradientView.mask = containerView
it does not show anything 😕 however when I do
gradientView.mask = anImageView
or
gradientView.mask = aUILabel
It apply mask nicely. Is there a way I can achieve
gradientView.mask = containerView
Upvotes: 1
Views: 323
Reputation: 19765
UIImageView
and UILabel
both have intrinsic content size, but not UIView
. Mask of a view has to have a frame set properly. Make sure that the containerView.frame
is set:
containerView.frame = gradientView.bounds
Also, make sure that containerView.backgroundColor
is set to UIColor.clear
.
Upvotes: 1