notification banner on ipad displayed upside down

2019-08-20 00:50发布

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条回答
爷、活的狠高调
2楼-- · 2019-08-20 01:23

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.

查看更多
登录 后发表回答