UIView clipsToBounds property: Does it improve performance?

前端 未结 3 862
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-13 01:47

The documentation says that the clipsToBounds property of UIView will clip the drawing to the bounds, or more precisely that the subView c

3条回答
  •  滥情空心
    2021-02-13 02:16

    The use case for clipsToBounds is more for subviews which are partially outside the main view. For example, I have a (circular) subview on the edge of its parent (rectangular) UIView. If you set clipsToBounds to YES, only half the circle/subview will be shown. If set to NO, the whole circle will show up. Just encountered this so wanted to share.

提交回复
热议问题