I am having an issue with Landscape mode in my iPad application.
I created a very small new project to show my issue
I set UIInterfaceOrientation in the pList to UIInterfaceOrientationLandscapeRight
In app delegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self.window makeKeyAndVisible];
MyController *myController = [[MyController alloc] init];
[self.window addSubview:myController.view];
return YES;
}
In MyController
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
NSLog(@"Bounds Height:%f %f", self.view.bounds.size.height, self.view.bounds.size.width);
}
I have also tried putting this in viewDidLoad with same results
If I start the application while holding the device in landscape orientation the NSLog outputs
Bounds Height: 1004.000000 Bounds Width: 768.000000
What do I need to do to get the correct results?
I am new to this iOS programming, all I am trying to do is anchor a UISlider to the bottom of the screen but when I am getting the incorrect coordinates I am unsure how to do it.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…