Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

does clipsToBounds = YES reduce my memory footprint?

Tags:

iphone

I have a pretty big view which is like 1000 x 1000. So I did clipToBounds = YES. Will this actually produce smaller bitmaps for the views?

like image 898
dontWatchMyProfile Avatar asked Dec 20 '25 08:12

dontWatchMyProfile


1 Answers

clipsToBounds drastically decreases performance. Try putting a bunch of views in a scroll view with clipsToBounds turned on, then add some content inside the view at areas it will actually have to clip (for example, the view has a corner radius), run and scroll. The scrolling will be very jerky.

You're not making the processor's job "easier" by telling it to render less, you're giving it MORE work to do which is deciding what to draw and what not to draw. That takes up cycles.

like image 125
NonatomicRetain Avatar answered Dec 22 '25 22:12

NonatomicRetain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!