Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Weird flicker when finishing a view animation

ukneequkneeq Posts: 313Registered Users @ @
edited January 2010 in iOS SDK Game Development
Ok, I have a view that I animate. During the animation it moves position and also scales down as it is moving. Once it finishes the animation in the animationDidStop method I set the CGAffineTransformMakeScale so that it should stay at the size it ended up with at the end of the animation.
view.transform = CGAffineTransformMakeScale(perspectiveScale, perspectiveScale);

On the simulator it is smooth and transparent, but when I built it and ran it on my iPhone it flickers real quick. From what I can tell as soon as the animationDidStop is called it quickly reverts back to the full size before it scales it back down. And that is what is causing the flicker. Does anyone know how I can get rid of the flicker? Thanks in advance!
Post edited by ukneeq on
<div style="float:left;width:150px"><img src="http://www.ukneeq.com/wp-content/uploads/2012/04/Icon@2x.png"; />
<a href="http://itunes.apple.com/us/app/ratscrew/id503993587?ls=1&mt=8"; target="_blank">RatScrew for iPhone and iPad</a></div><div style="float:left;width:150px"><img src="http://www.ukneeq.com/wp-content/uploads/2012/05/Icon@2x.png"; />
<a href="http://itunes.apple.com/us/app/basic-slap-jack/id519854094?ls=1&mt=8"; target="_blank">Basic Slap Jack for iPhone and iPad</a></div>

Replies

  • chhavi0710chhavi0710 Posts: 11Registered Users
    edited January 2010
    Hi,

    I m suffering from the same issue..., have u got any solution. Please guide me though.


    Thanks
    Chhavi
  • ApplessonApplesson Posts: 55Registered Users
    edited January 2010
    Maybe it works if you change the size of the frame instead?
  • chhavi0710chhavi0710 Posts: 11Registered Users
    edited January 2010
    Applesson wrote: »
    Maybe it works if you change the size of the frame instead?

    Hi Applesson,

    I m not using any frame for making animation effect, my code is as follows:
    [blocksView removeFromSuperview];
    [gameView addSubview:gameMenuView];
    [UIView beginAnimations:nil context:NULL]; 
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationDuration:1.0];
    [UIView setAnimationRepeatCount:0.75];
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:gameView cache:NO];
    [UIView commitAnimations];
    
    

    Its very simple code and runs very fine on simulator, but on real device black horizontal lines or flickering is shown while animating the screens.

    And one thing more, when i am using "UIViewAnimationTransitionFlipFromLeft" rather than "UIViewAnimationTransitionCurlUp", its not showing any flickering...

    Please help me out.


    Thanks,
    Chhavi
  • Amit-MajumdarAmit-Majumdar New DelhiPosts: 2New Users Noob
    ukneeq wrote: »
    Ok, I have a view that I animate. During the animation it moves position and also scales down as it is moving. Once it finishes the animation in the animationDidStop method I set the CGAffineTransformMakeScale so that it should stay at the size it ended up with at the end of the animation.
    view.transform = CGAffineTransformMakeScale(perspectiveScale, perspectiveScale);
    

    On the simulator it is smooth and transparent, but when I built it and ran it on my iPhone it flickers real quick. From what I can tell as soon as the animationDidStop is called it quickly reverts back to the full size before it scales it back down. And that is what is causing the flicker. Does anyone know how I can get rid of the flicker? Thanks in advance!

  • Amit-MajumdarAmit-Majumdar New DelhiPosts: 2New Users Noob
    May be you should try

    view.transform = CGAffineTransformScale(view.transform,perspectiveScale, perspectiveScale);

    It takes an extra parameter a transform arg. The 'transform' arg in your case represents the enlarged view.
Sign In or Register to comment.