开发者

uiview Transition problem

开发者 https://www.devze.com 2022-12-12 05:56 出处:网络
i have a UIview holding two other UIviews. that two subviews having 15 buttons and images. i have to translate the parent view. but开发者_Python百科 the translation is not smooth in 3g phone. im using

i have a UIview holding two other UIviews. that two subviews having 15 buttons and images. i have to translate the parent view. but开发者_Python百科 the translation is not smooth in 3g phone. im using UIviewanimation and CGAffineTransformTranslate for translating the view. please help me for making it more smoother.


This is a though question to answer in a general way. I have had views that scrolled smoothly suddenly animating jerkily after just a small change. In short, you need to make sure to have as few subviews as possible and have as few non-opaque views as possible (pngs with alpha values translates to non-opaque UIImageViews).

If all else fails, you can render the whole view into an image, switch out the view for the image just before scrolling, and then re-insert the view again after the animation. That way, you are only moving one big and (hopefully) opaque view.


If you have many images make sure they are small-sized, otherwise theyd take up too much memory and there would be nothing to do. To my experience 4-5 large images(740-480) were too much for the phone to handle.

0

精彩评论

暂无评论...
验证码 换一张
取 消