私は画面遷移に関する質問があります。トランジットへpresentViewControllerはview.frameを変更しますか?
画面、私はよくpresentViewControllerメソッドを使用します。
NextViewController *nextViewController = [[NextViewController alloc] init];
nextViewController.view.frame = CGRectMake(10, 10, 200, 400);
[self presentViewController:nextViewController animated:YES completion:nil];
ただし、実装したview.frame設定は適用されません。次のコード
は正常に動作します。
NextViewController *nextViewController = [[NextViewController alloc] init];
[self presentViewController:nextViewController animated:YES completion:nil];
nextViewController.view.frame = CGRectMake(10, 10, 200, 400);
これらのコードの違いは何ですか? view.frameはpresentViewControllerメソッドで再定義されていますか?
ありがとうございました。
しかし、次のように、NextViewControllerでview.frameを設定することはできません。 [super viewDidLoad]; self.view.frame = CGRectMake(10、10、200、400); – akiniwa
あなたが間違っていない場合、私はviewDidLoad関数でフレームを設定していますか? –
私は両方の方法を試しました。 rootViewControllerの "nextViewController.view.frame"、 "[super viewDidLoad];"の後の "self.view.frame" nextViewControllerで – akiniwa