Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/105.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 新的UIViewController框架为320x480,而不是更大的屏幕尺寸_Ios_Objective C_Uiviewcontroller - Fatal编程技术网

Ios 新的UIViewController框架为320x480,而不是更大的屏幕尺寸

Ios 新的UIViewController框架为320x480,而不是更大的屏幕尺寸,ios,objective-c,uiviewcontroller,Ios,Objective C,Uiviewcontroller,我今天更新了Xcode AppDelegate.m: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.vc = [[ViewControll

我今天更新了Xcode

AppDelegate.m:

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

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    self.vc = [[ViewController alloc] init];
    UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:self.vc];
    self.window.rootViewController = nc;
    [self.window makeKeyAndVisible];

    return YES;
}
ViewController.m:

- (void)viewDidLoad {
    [super viewDidLoad];
    CGRect f = self.view.frame;
    f =[[UIScreen mainScreen] bounds];
    self.view.frame = f;
    self.view.backgroundColor = [UIColor redColor];
}

框架显示为320x480。我可以清楚地看到视野周围有更多的空间,但它是黑色的。为什么视图没有填充?没有XIB。

您需要添加正确的启动屏幕图像或启动屏幕文件,以正确支持更大的屏幕。啊,谢谢。不直观!调用[self.view setNeedsLayout];在设置其框架之后。