开发者

problem in converting my project from portrait to landscape orientation

开发者 https://www.devze.com 2023-02-14 14:43 出处:网络
I have developed my project in portrait orientation, now I want to set my project orientation in landscape . I have set all xib file\'s orienta开发者_Python百科tion property as landscape and in .plist

I have developed my project in portrait orientation, now I want to set my project orientation in landscape . I have set all xib file's orienta开发者_Python百科tion property as landscape and in .plist also I have set all the items of Supported interface orientations as landscape, but when I run my project one view still comes in portrait orientation... in this view i am showing pdf file.

Thanks in advance !!!


did you put the following method in you view controller

- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    return YES;
}


if Landscape use this code

(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    return (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight);
}

if Portrait use this code

(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    return (interfaceOrientation==UIInterfaceOrientationPortrait || interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown);
}
0

精彩评论

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