Reputation: 1396
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 orientation 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 !!!
Upvotes: 3
Views: 506
Reputation: 13
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);
}
Upvotes: 1
Reputation: 1716
did you put the following method in you view controller
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return YES;
}
Upvotes: 2