ios - Transform performance -
how performance on transforming uiview?
i have advanced uiview on ipad want show in smaller scale on iphone. easy hack transform on uiview:
self.view.transform = cgaffinetransformscale(cgaffinetransformidentity, 0.5, 0.5); this fits view well, how performance?
the alternative create every item in view able scale according device.
is transform considered bad practice when comes scaling uiviews?
thanks.
since gpu accelerated operation there's no performance downside (at to the lowest degree none matter in real life).
but note may not access frame property more, it's considered invalid: instead, need access/modify bounds , center. i've had problems autolayout , transforms due this, ymmv.
from transform documentation:
warning: if property not identity transform, value of frame property undefined , hence should ignored.
so if can live restriction there's nil wrong applying transform (rotation , translation fine).
ios iphone objective-c ipad uiview
No comments:
Post a Comment