开发者

Landscape Mode: Flip image when you flip your iPad

开发者 https://www.devze.com 2022-12-26 19:21 出处:网络
Apple demonstrated Photo\'s for the iPad. In their demo, they said you can Flip the iPad and it flips the image.

Apple demonstrated Photo's for the iPad. In their demo, they said you can Flip the iPad and it flips the image.

How is this result achieved?

I've been reading ab开发者_Go百科out UIInterfaceOrientation all day and I'm lost

Any help would be appreciated.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation];
//  NSLog(@"orientation: %@", [orientation )
if(orientation==UIInterfaceOrientationPortrait ||orientation==UIInterfaceOrientationPortraitUpsideDown) {
    //Code
    return NO;
}  
if (orientation==UIInterfaceOrientationLandscapeRight ||orientation==UIInterfaceOrientationLandscapeLeft ) {
    //Code
    return YES;
}
return NO;
}


You implement in your UIViewController subclass:

- (BOOL)shouldAutorotateToDeviceOrientation:... {
    Return YES;
}

And most of the time the UIKit manages it all for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消