iphone - ipad app not works for landscape mode -
The iPad is okay for the picture, but the landscape is not working,
I use code hereby
- (bool) isPad {UI_USER_INTERFACE_IDIOM return #ifdef (UI_USER_INTERFACE_IDIOM () == UIUserInterfaceIdiomPad); # Return not return; #endif} - (bool) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) // return to interfaceOrientation {supported tilt yes if ([self isPad]) {return YES; } And {return UIInterfaceOrientationIsPortrait (Interface Orientation); }} - (bool) isPadLandscape {return (UI_USER_INTERFACE_IDIOM () == UIUserInterfaceIdiomPad & amp; & amp; (self.interfaceOrientation == UIInterfaceOrientationLandscapeRight || self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft)); } - (bool) isPadPortrait {return (UI_USER_INTERFACE_IDIOM () == UIUserInterfaceIdiomPad & amp; & amp; (self.interfaceOrientation == UIInterfaceOrientationPortrait || self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)); } - (void) willAnimateRotationToInterfaceOrientation: (UIInterfaceOrientation) toInterfaceOrientation period: (NSTimeInterval) period {if ([self isPadPortrait]) {[imageView setFrame: CGRectMake (0, -50, 768, 1024)]; } And if ([it's own pedal landscape]) {[imageView setframe: CGRactam (0, 0, 1024, 768)]; I try to call - (BOOL) is the padlundscape method during debug, but that method is not called, what Can be wrong?
Do not forget to set the property supported interface orientations (iPad) Suitable Supported Status in Your Info.plist File Or try this:
- (BOOL) is I}
Comments
Post a Comment