iOS 앱에서 UIViewContainment를 사용하고 있습니다. 에서 내 containerView에 contentView가 있고 그것에 다른보기를로드하려고합니다. 자식 뷰는 스크린 샷과 같이 올바르게 크기가 조정되지 않아 제대로로드됩니다.UIViewContainment 하위 컨트롤러의 크기가 올바르게 맞지 않음
NavigationBar는 컨테이너의 일부입니다. 여기
내가 용기 내부의 childViewController를로드하는 데 사용하고있는 코드입니다.// load the new controller
self.contentViewController = [self.storyboard instantiateViewControllerWithIdentifier:menuItem.viewControllerStoryboardId];
[self.containerView addSubview:self.contentViewController.view];
[self.contentViewController didMoveToParentViewController:self];
[self addChildViewController:self.contentViewController];
self.title = menuItem.title;
다음은 작동하는 것 같다 :
self.contentViewController.view.frame = CGRectMake(0, 64, self.containerView.bounds.size.width, self.containerView.bounds.size.height);
고마워요! 나는 단지 그것을했고 그것은 아무것도 바뀌지 않았다. 내 childViewController에는 탐색 모음이 없습니다. –
나는 저를 위해 작동하는 가능한 응답을 가진 나의 질문을 편집했다! –