SplitViewControllerの詳細ビューにtabBarControllerを追加できます。そのコントローラーのxibファイルにUIViewController
応答するを作成し、オブジェクトを追加してUIViewControllerにリンクするだけです。ビューにタブバーコントローラーを追加します。<UITabBarControllerDelegate>
UITabBarController
viewDidLoad
-(void)viewDidLoad {
...
[self addChildViewController:myTabBarController];
//add the tabBarController view
[self.view addSubview:myTabBarController.view];
}
これUIViewController
は詳細ビューに割り当てられます。これはうまくいき、私は以前に試しました。しかし、アップルがそれを許可するかどうか?わからない!
編集:
まず第一に、決して自分自身を呼ぶべきではありませんviewDidLoad
。
また、コントローラーがxibファイルのSplitViewControllerにリンクされている限り、必要ないと思いrootipad
ます。detailipad
あなたのRootViewiPad
(マスター)の中に以下を追加してくださいviewDidLoad
:
-(void)viewDidLoad {
...
if (self.interfaceOrientation == UIInterfaceOrientationPortrait || self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
//select the first row to load
[self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionNone];
//NOTE, I'm assuming that selecting the cell will load the detail view.
//if that is not the case, you need to do what ever you need to load the
//detail view.
}
}
この動作を毎回(最初のロード時だけでなく)発生させたい場合は、-(void)viewWillAppear
代わりにコードをメソッドに追加してください。