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

BarryK88

macrumors member
Original poster
Mar 1, 2011
31
0
I've got several images within my view. On rotation my images are being placed properly by means of a CGAffineTransformTranslate & Rotate.

However when I launch in PortraitUpsidedown a translation takes place which I defined wihin the method:


Code:
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {

This translation only has to take place on a orientation change with the device. How can I make sure that this translation doesn't happen on Launch?
 
Still didn't figure this one out.

Here's a piece of code of my project.

-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {

[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];

if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
image1.transform = CGAffineTransformTranslate( image1.transform, -65.0, 255.0);
image2.transform = CGAffineTransformTranslate( image2.transform, -65.0, 255.0);

}
else {

speler1.transform = CGAffineTransformTranslate( speler1.transform, 65.0, -255.0);
speler2.transform = CGAffineTransformTranslate( speler2.transform, 65.0, -255.0);

}

}


Some tips are greatly appreciated.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.