3
votes

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 !!!

2
Try setting the frame of that element when the orientation changes - ThE uSeFuL
You mean that all the views should be changed to Landscape orientation provided whatever may be the orientation is. - SNR

2 Answers

2
votes

did you put the following method in you view controller

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

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);
}