【问题标题】:notification banner on ipad displayed upside down when app is launching Landscape (left home button)应用程序启动时,ipad 上的通知横幅倒置显示横向(左主页按钮)
【发布时间】:2012-03-29 19:57:44
【问题描述】:

我有一个支持两种方向的 iPad 应用程序,我在 info.plist 上将支持的界面方向设置为横向(右主页按钮)和横向(左主页按钮)。我还将初始界面方向设置为横向(右主页按钮)。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

    [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
}

当我收到推送通知并且我的应用程序已关闭时。我不是从通知中启动应用程序的。通知横幅出现上下颠倒。仅当我在横向(左主页按钮)上按住 ipad 时才会发生这种情况。有什么我想念的吗?任何帮助,将不胜感激。提前致谢,

【问题讨论】:

    标签: objective-c cocoa-touch ipad ios5 apple-push-notifications


    【解决方案1】:

    我也面临同样的问题并尝试了很多方法; 在我的应用中,我只需要横向,所以我设置了

    return UIInterfaceOrientationIsLandscape(interfaceOrientation);

    shouldAutorotateToInterfaceOrientation 中的每个ViewController

    info.plist 中,我正在设置支持的界面方向

    <array>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    

    这解决了我的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多