以下は、didFinishLaunchingWithOptions のアプリ デリゲートからの私のコードです。
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
CGRect windowFrame = self.window.frame;
UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, windowFrame.size.height-100, windowFrame.size.height, windowFrame.size.height)];
bottomView.backgroundColor = [UIColor redColor];
[self.window addSubview:bottomView];
// self.viewController.view.frame = CGRectMake(0, 0, windowFrame.size.width, windowFrame.size.height-100);
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
私のViewControllerはFreeFormで、その高さは約245です。ご覧のとおり、高さ100ポイントのボトムビューを配置しようとしています。
私はこれを学ぼうとしているだけです。
しかし、ビューは常に画面全体を埋め尽くします。View ControllerをWindows rootviewcontrollerとして設定することをコメントアウトすると、画面にbottomviewが表示されます。
私は何を間違っていますか?ご意見をお聞かせください。
ありがとう。