notification banner on ipad displayed upside down when app is launching Landscape (left home button)

南笙酒味 提交于 2019-12-11 20:07:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!