开发者

Landscape Mode: Flip image when you flip your iPad

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜