UISplitViewController
을 UITabBarController
내부에서 UIViewController
을 분할 뷰의 마스터 창에 사용하고 UINavigationController
를 자체 창에 바닐라 UIViewController
가 들어있는 세부 창에 사용하고 있습니다.호출되지 않은 메서드를 위양하는 UISplitViewController
애플은 루트 레벨에서만 분할보기를 사용하도록 권고하고 있지만, 분할보기를 탭으로 사용하는 다른 응용 프로그램 (예 : Amazon-Wish List 탭)을 보았 기 때문에 가능하다고 확신합니다. .
내 문제는 분할 뷰의 대리자 메서드 즉, UISplitViewControllerDelegate
에있는 사람들이 호출되지 않아 Portrait 모드로 전환 할 때 팝업 메뉴가 나타나지 않습니다.
문제의 방법은 다음과 같습니다. -
// Called when a button should be added to a toolbar for a hidden view controller
- (void)splitViewController: (UISplitViewController*)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController: (UIPopoverController*)pc;
// Called when the view is shown again in the split view, invalidating the button and popover controller
- (void)splitViewController: (UISplitViewController*)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem;
// Called when the view controller is shown in a popover so the delegate can take action like hiding other popovers.
- (void)splitViewController: (UISplitViewController*)svc popoverController: (UIPopoverController*)pc willPresentViewController:(UIViewController *)aViewController;
UISplitViewController
는 회전 알림을받습니다.
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
를 사용하여 응용 프로그램 시작 부분에 가로 또는 오른쪽으로 상태 표시 줄 방향을 강제로 설정하면 willShowViewController 메서드를 호출 할 수 있습니다. 그러나 willHideViewController
doesn 전화하지 마. 그리고 나는 앱을 풍경에서 시작하도록하고 싶지 않다. 내가 똑같은 일을하지만 인물 사진을 찍으 려한다면 콜백을받지 못합니다.
분할보기 컨트롤러가 그렇지 않으면 올바르게 작동 할 때 대리자 메서드를 호출하지 않는 이유를 모르겠다. 이러한 메소드는 내부적으로 메소드
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
에서 호출되어야하며 내부에서 중단 점을 만들 때 위임자가 설정되어 있고 아직 활성 상태인지 확인할 수 있습니다.
하루 종일 붙어있어! 다른 모든 것은 훌륭하게 작동하고 있으며 splitview/tabbar/navbar 조합이 잘 작동하는 것을 매우 기쁘게 생각합니다. 이 알림이 필요합니다.
회전 할 때 수동으로 호출해야할까요? `UISplitViewController '가이를 수행해야 할 때 매우 잘못되었습니다.
안녕하세요, 해결책을 조금 더 자세하게 설명해 주시겠습니까? 저는 지금 같은 종류의 문제가 있습니다. 나는 3 탭에서 splitview가있는 1 tabcontroller 있어요. 각 splitview에 detailview를 추가하여 splitview를 위임 한 자체 서브 클래 싱 된 navigationcontroller에 추가했습니다. 현재 보이는 탭에서는 완벽하게 작동하지만 다른 탭에서는 작동하지 않습니다. 그래서 내보기를 회전하고 그것을 바꿀 때까지 모든 엉망으로 보이는 탭을 변경할 때. 다시 한 번, 가시적 인보기에만 해당됩니다. –
흠, 죄송합니다. 나는 어딘가에 splitview 탭과 회전 사이의 변경으로 인해 문제가 발생했음을 알리는 게시물을 보았을 것입니다. splitviwe은 항상 윈도우 레벨에 있어야합니다. 탭 컨트롤러. 내가 추측하는 워드 프로세서에 의해 백업됩니다. 실제로 수평 분할이 필요하므로 처음부터 SplitView를 빌드하는 경로를 취하고 있습니다. – Sam
처음부터 시도해 보는 대신 http://mattgemmell.com/2010/07/31/mgsplitviewcontroller-for-ipad – Viraj