나는 UIView
을 UITabController
에 가지고 있습니다. 그리고 그것에 UITableView
가 있습니다.uiview의 자동 크기 조정
통화 상태 표시 줄에서 전환 할 때 아무 것도하지 않고보기의 크기가 자동으로 조정되지 않습니다.
앱이 시작될 때 UIStatusBar
통화가 토글되었지만 앱이 실행되는 동안 UIStatusBar
이 토글되면 여부에 따라 적절한 크기가 적용됩니다.
UINavigationController
이 포함 된 다른 탭보기는 괜찮게 잘리는 것처럼 보입니다. 여기
는
if ([indexPath indexAtPosition:0] == 0 || [indexPath indexAtPosition:0] == 1) { if (!airportChooser) { airportChooser = [[AirportChooserController alloc] init]; airportChooser.targetController = self; airportChooser.view.autoresizesSubviews = YES; airportChooser.view.autoresizingMask = UIViewAutoresizingFlexibleHeight; [airportChooser.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleWidth]; } airportChooser.target = [indexPath indexAtPosition:0]; [self.parentViewController.parentViewController.view addSubview:airportChooser.view]; self.parentViewController.parentViewController.view.autoresizesSubviews = YES; self.parentViewController.parentViewController.view.contentMode = UIViewContentModeRedraw; [self.parentViewController.parentViewController.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleWidth]; airportChooser.view.contentMode = UIViewContentModeRedraw; //[airportChooser open]; }
나는이 두 가지를 모두 마쳤지 만 운이 없다. 이제 뷰를 창에 추가하고 (push 뷰 컨트롤러를 사용하여 이전 예제를 수정했다.) 앞에서 설명한 것과 동일한 효과가있다. 뷰를 추가한다. 상태 표시 줄의 위치에 따라 적절한 위치에 있지만 열리지 않으면 조정 응용 프로그램에서 하위보기를 추가하면 올바르게 작동합니다. 하지만 나중에 사용자 입력 결과로 추가하면 – msaspence
보스! 당신은 저에게 "autoresizesSubviews"속성을 알려줌으로써 나의 삶을 구했습니다! 프로그래밍 방식으로 하위보기를 만드는 동안 발생한 문제에 직면했지만 superview는 스토리 보드에있었습니다. "이 소책자는 서브 뷰가 제대로 설정 한 후에도 나를 심하게 죽인 자동 크기 설정을 요구하고 있습니다." +1 엄지 손가락 업! – Prasanna