ios - How to create UIView with custom shape propely? -


i have create uiview custom shape, such triangular, half-rect, etc. used crop special image form , set background of view. although popular solution, not sure whether efficient 1 in terms of sustainability.

on other hand, found useful way of solving problem cashapelayer()

could please provide pros , cons of both approaches?

cashapelayer way!

with little effort can achieve same result less memory (ram) , less maintenance time (if want make triangle thicker example, you'll need new image small change in code , have it!). app size relatively smaller , don't have worry resolution images.

hope helps!


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -