繁体   English   中英

XCode 6 UIViewController无法调整大小以填充屏幕

[英]XCode 6 UIViewController not resizing to fill screen

我在XCode 6.4上创建了没有Storyboard的应用程序,当我运行该应用程序时,无论使用哪种模拟器,我总会得到一个(320,480)屏幕。

- (BOOL)application:(UIApplication *)application 
  didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    UIViewController *vc = [[UIViewController alloc] init];
    vc.view.backgroundColor = [UIColor whiteColor];
    self.window.rootViewController = vc;
    [self.window makeKeyAndVisible];
    return YES;
}

参考img: http : //i.stack.imgur.com/hGHmt.png

已经尝试过:

vc.view.autoresizingMask = 
             UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;

我应该怎么做才能使其覆盖整个屏幕?

我遇到了同样的问题,您应该将应用程序的启动图像设置为640 x 1136像素,大小为default-568@2x.png 更多信息-> 链接

同时设置@2x @3x图像资产将对您有好处。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM