Note that there are some explanatory texts on larger screens.

plurals
  1. POImproving Smoothness of Simple Animations
    text
    copied!<p>I am developing my first iPhone application, and I have made it past the "machinery" and now I am wrapping up fit &amp; finish details.</p> <p>I have a view that slides in from the bottom of the screen for my settings pane. The view itself has an opacity of 0, and has a UIImageView view inside of it with a PNG creating the actual background for the view, behind the controls. I am using the built in animation calls for UIView, as in;</p> <pre><code>[self.view addSubview:settingsViewController.view]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.5]; [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; frame.origin.y = 200.0; settingsViewController.view.frame = frame; [UIView commitAnimations]; </code></pre> <p>Unfortunately, the animation on the device is choppy. The PNG I am using as my background is transparent only in the uppermost 30 pixels across it's width. If I use a PNG with no transparency, the animation is smooth.</p> <p>The application itself is highly graphical, so the view is animating out over top of a screen full of other PNGs.</p> <p>I would be extremely surprised if the device can't handle this type of animation smoothly, which leads me to believe I need to refine my approach. Thoughts I had so far include;</p> <p>Perhaps I need to use Core Animation directly? Would caching the view behind the settings pane before animating be beneficial somehow?</p> <p>This is new territory for me, and I know there must be ways to optimize that are considered good practice. Thanks for your time!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload