0

Hi I create app for ios 5 and 6, I need to reposition my button depend on interface orientation. Problem is that:

ios 5: it return UIInterfaceOrientationLandscapeRight while ios 6 it return UIInterfaceOrientationLandscapeLeft.

So I cannot reposition my button correctly

I don't know how to deal with this, or I need to change something in setting. Thank you for your help!

Shaik Riyaz
  • 11,204
  • 7
  • 53
  • 70
sokna
  • 21
  • 1
  • I believe with iOS 6+ certain rotation events are forwarded to child view controllers automatically. If you're on iOS 5 they're not - you have to forward them yourself. If you don't then things don't always work right. It's not explicitly documented as such, but see [`shouldAutomaticallyForwardRotationMethods`](https://developer.apple.com/LIBRARY/IOS/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html) *Available in iOS 6.0 and later* Do you have some sort of custom navigation setup/navigation view controller? – ta.speot.is Dec 20 '13 at 02:39
  • I don't use navigationviewcontroller, I use uiviewcontroller as a root viewcontroller. – sokna Dec 20 '13 at 07:15

1 Answers1

0

I have no idea why the orientations are different.But maybe you can solve the problem like this

UIDevice *device = [UIDevice currentDevice];
NSString *tem = device.systemVersion;   
if ([tem intValue]>=6){    


}     
else if{          

}
Rufus
  • 640
  • 1
  • 7
  • 14
  • I want to finger out what orientation of my device(landscapeleft or right) to reposition button. But it return in the opposite result between device ios 5 and device ios 6. Anyway thanks for answering. – sokna Dec 20 '13 at 07:19