简体   繁体   English

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

[英]XCode 6 UIViewController not resizing to fill screen

I'm creating an app without Storyboard on XCode 6.4 and when I run the app, no matter which simulator I use, I always get a (320,480) 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;
}

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

Already tryed: 已经尝试过:

vc.view.autoresizingMask = 
             UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;

What should I do to make it fill the whole screen? 我应该怎么做才能使其覆盖整个屏幕?

I had the same problem, You should set launch image of your app about default-568@2x.png with 640 x 1136 pixel size. 我遇到了同样的问题,您应该将应用程序的启动图像设置为640 x 1136像素,大小为default-568@2x.png More info --> link 更多信息-> 链接

Also setting @2x @3x image assest will be good for you. 同时设置@2x @3x图像资产将对您有好处。

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

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