How to mask UIViews in iOS

前端 未结 3 725
隐瞒了意图╮
隐瞒了意图╮ 2020-11-30 23:59

I\'ve seen similar questions, but haven\'t found workable answers.

I want to mask a UIView using a grey image (need to convert to alpha scale for masking). The UIVi

3条回答
  •  日久生厌
    2020-12-01 00:08

    I don't know the exact code off the top of my head but the basic idea is to have two UIViews. One UIView would have it's image property set to be the grey scale image and the other UIView would be set as usual the only difference is that you would position the initial UIView directly on top of the UIView containing the "normal" image.

    I hope that is enough to push your idea a step further.

提交回复
热议问题