【问题标题】:How to change [UIApplication sharedApplication].window orientation along with device in iOS如何在 iOS 中随设备更改 [UIApplication sharedApplication].window 方向
【发布时间】:2015-04-13 11:39:08
【问题描述】:

在我的应用程序中,我想将 UIview 添加为 AppDelegate.Window 上的子视图。 UIView 框架为 (0,0,1024,768)。在窗口上添加视图后,它只覆盖了屏幕的一半。

我的理解是视图尺寸是屏幕横向尺寸。窗口处于纵向模式。

【问题讨论】:

    标签: ios objective-c uiview uiwindow uiapplication


    【解决方案1】:

    尝试提供动态宽度和高度,而不是通过 1024 和 768 来修复它。您可以传递 AppDelegate.Window.bounds.width 和 AppDelegate.Window.bounds.height。

    喜欢。

     CGRectMake (0,0,UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height);
    

    【讨论】:

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