For an UIImageView, different mode options are given In the interface builder like Aspect Fit, Aspect Fill. Can anyone tell me what is the difference b/w these two modes: Scale to Fill VS Redraw?
UIViewContentModeScaleToFill
For the first time, drawRect:
is called and view is rendered. Later, when geometry changes, drawRect:
is not called and already rendered content is scaled to draw the view.
UIViewContentModeRedraw
Every time you change bounds, drawRect:
is called to render the view again, again and again. Unless you know what are you really doing and unless you really need it, don't use it. It's much slower, because it must call drawRect:
again and again. In other words, when you set UIViewContentModeRedraw
it's same behavior as when you call setNeedsDisplay
every time bounds are changed.
Simplified explanation, but should clarify it a bit for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With