Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIView clipsToBounds property: Does it improve performance?

The documentation says that the clipsToBounds property of UIView will clip the drawing to the bounds, or more precisely that the subView can't draw outside of the bounds of the superView.

Sounds nice, but what does that mean in practice?

If I set that to YES, then my subView will automatically only draw those parts which are not outside the bounds of the superView. so it increases the overall performance or do I still have to make sure that I don't create any views that are not visible, i.e. inside a UIScrollView ?

like image 330
Thanks Avatar asked May 04 '09 16:05

Thanks


1 Answers

I think it's the opposite: turning on clipping hurts performance because it has to set up a clipping mask. I vaguely remember reading this somewhere, but I can't find it now.

like image 59
Daniel Dickison Avatar answered Sep 22 '22 09:09

Daniel Dickison