问题
I had an iPad app that supports two Orientation I set Supported interface orientations on info.plist to Landscape (right home button) and Landscape (left home button). I also set Initial interface orientation to Landscape (right home button).
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
}
When I receive push notification and my app is closed. And I started the app not from notification. The notification banner appears up-side down. This happens only when I'm holding ipad on Landscape (left home button). Is there something I'm missing? Any help would be appreciated. Thanks in advance,
回答1:
I am also facing same issue and tried many ways; In my app I require only landscape orientation so I set
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
in shouldAutorotateToInterfaceOrientation
of every ViewController
and in info.plist
for supported interface orientation I am setting
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
This solved my problem.
来源:https://stackoverflow.com/questions/9683658/notification-banner-on-ipad-displayed-upside-down-when-app-is-launching-landscap