0
次のコードを使用してビューをアニメーション化します。私は画面を画面の中央から上に向けて見ることを期待しています。UIViewの遷移が期待通りではありません
ViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"ChildViewController"];
[UIView transitionWithView:viewController.view
duration:0.5
options:UIViewAnimationOptionTransitionNone
animations:^{
viewController.view.frame = CGRectMake([UIScreen mainScreen].bounds.size.width/2, [UIScreen mainScreen].bounds.size.height/2 , 18, 36);
}
completion:nil];
[viewController willMoveToParentViewController:self];
[self.view addSubview:viewController.view];
[self addChildViewController:viewController];
[viewController didMoveToParentViewController:self];
このコードは動作しますが、ビューは、上部の中心点に由来しなければならないが、それは上部の左点由来します。なぜそうなのか?