0

i m working on a project in which i want to rotate the ipad at the launch time.i have done coded for it.But it still not working. code i have written-

in .m file

-(void)viewWillAppear:(BOOL)animated
{

[[UIDevice currentDevice]setOrientation:UIInterfaceOrientationLandscapeRight];
}


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
     return (interfaceOrientation = UIInterfaceOrientationLandscapeRight);
}
Aaron
  • 1,342
  • 2
  • 16
  • 34

3 Answers3

2

Add "Initial interface orientation" to your info plist and set the value to "Landscape (right home button)". The type is String I think.

Aaron
  • 1,342
  • 2
  • 16
  • 34
0

See previous answers on this topic Is there a documented way to set the iPhone orientation?

Community
  • 1
  • 1
Roger
  • 15,793
  • 4
  • 51
  • 73
0

Add Initial interface orientation to tour info.plist and set its value as Landscape (right home button)

visakh7
  • 26,380
  • 8
  • 55
  • 69