In ViewController.m
, on an iPad, if we print out the view's frame height in a tap event handler:
NSLog(@"Height of main view is %f", self.view.frame.size.height);
then in Portrait mode, the value is 1004 (20 pixel for device status line, so 1024 - 20 = 1004), and if the device is rotated to Landscape mode, I expected it to be about 768 or 748, but the value printed is actually 1024. (update: if the app is started in Landscape mode, then without rotation, it is also printed as 1024). Why would that be, and is there a rule of thumb to expect getting the value of 748 or 768? (Is there more than one way to get that?)
autoresizingMask
property correctly set with flagUIViewAutoresizingFlexibleHeight
? – psychoUIWindow *window = [[[UIApplication sharedApplication] delegate] window]; window.autoresizingMask |= UIViewAutoresizingFlexibleHeight; self.view.autoresizingMask |= UIViewAutoresizingFlexibleHeight;
in theviewDidLoad
method and compiled and rotated a few times and the height still came out as 1024 – Jeremy L