0

I am not able to rotate a single screen from portrait to landscape. So if i want to do this, then i have to revise the whole application into portrait and landscape mode?

Cœur
  • 37,241
  • 25
  • 195
  • 267

3 Answers3

0

No you don't need to revise the whole application.

There are some delegate method By which you can do it. If your app has tabbar or navigationbar see my question also answered by me. It will help.

Community
  • 1
  • 1
Rashad
  • 11,057
  • 4
  • 45
  • 73
0

Use this method if you want to rotate screen in landscape mode

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

 {

return UIInterfaceOrientationIsLandscape(interfaceOrientation);

}

if you want to rotate in all the direction then return YES;

Gajendra Rawat
  • 3,673
  • 2
  • 19
  • 36
0

I am also find the same problem.i have found that shouldAutorotate function not call every time so i change orientation programmatic

first import this

#import <objc/message.h>

then

-(void)viewDidAppear:(BOOL)animated
{

     if(UIDeviceOrientationIsPortrait(self.interfaceOrientation)){
        if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)])
        {
            objc_msgSend([UIDevice currentDevice], @selector(setOrientation:), UIInterfaceOrientationLandscapeLeft );


        }
    }

}

hope this help you.

Sumit Mundra
  • 3,891
  • 16
  • 29