My application supports all orientation, but in some cases I want to lock the screen in
portrait / landscape.
In my application, I have two types of pdf document.
one is in the portrait document, and the other is in the landscape document.
I want to open portrait document only in portrait mode, and landscape document in
only landscape.
I want to do this: if my application is open in landscape mode, and I click on
portrait document, so it should rotate in portrait mode and the same as for landscape, if
my application is open in portrait mode, and when I click on the landscape document,
you need to rotate or open the document only in the landscape.
hope i make you guys sorry my english hope you understand what i want please
I need your help.
Thank you in advance
here is my code:
- (void)viewDidLoad { [super viewDidLoad]; UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) { NSLog(@"Portrait"); if ([orientationObject isEqualToString:@"p"]) { //If the document is portrait pdfScrollViewFrame = CGRectMake(-0.0, -80.0, 770.0, 1085.0); } else{ // If the document is landscape pdfScrollViewFrame = CGRectMake(-0.0, -40.0, 770.0, 1130.0); } } else{ NSLog(@"Landscape"); if ([orientationObject isEqualToString:@"p"]) { //If the document is portrait pdfScrollViewFrame = CGRectMake(65.0, -80.0, 620.0, 1110.0); } else{ //if the document is landscape pdfScrollViewFrame = CGRectMake(0.0, -40.0, 740.0, 1070.0); } }