I would like to animate the movement of my view as the device rotates, changing alpha to 0, moving the view to a new position and reset alpha-1.
Using this code in didRotateFromInterfaceOrientationcauses the view to flash and quickly disappear, and then reappears. I would like to avoid this.
[UIView animateWithDuration:kAnimationDuration animations:^{
anObject.alpha = 0.0;
CGRect newFrame = anObject.frame;
newFrame.origin.x = newX;
newFrame.origin.y = newY;
newFrame.size.width = newWidth;
newFrame.size.height = newHeight;
anObject.frame = newFrame;
} completion:^ (BOOL finished){
if (finished) {
anObject.alpha = 1.0;
}
}];
Is there a way to blink?
thank
source
share