Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

AguaRas

macrumors newbie
Original poster
Nov 27, 2012
2
0
Hello.
This developing an application that makes an animation of a view in the x-axis of 320, so that it appears to the right.

Code:
 [self.view setTransform:CGAffineTransformMakeTranslation(320, 0)];

The problem I have is when the iPhone is in portrait and the animation comes from the bottom, rather than the right.

What I can do to make it always right?
 

jnoxx

macrumors 65816
Dec 29, 2010
1,343
0
Aartselaar // Antwerp // Belgium
Code:
         [UIView animateWithDuration:0.3 animations:^{
            [currentLayer setFrame:CGRectMake(350, currentLayer.frame.origin.y, CGRectGetWidth(currentLayer.frame), CGRectGetHeight(currentLayer.frame))];
        }];

Something like that; you can play with the frame you give it, it expects, X/Y, WIDTH/HEIGHT as parameters :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.