各タブ項目にテーブルビューを含むタブコントローラーを含む分割ビューコントローラーがあります-すべて「マスター側」にあります。テーブルビューには、「詳細側」に表示される内容を制御するためにユーザーが選択できるアイテムのリストが表示されます。
ユーザーが画面をタップしてマスターテーブルビューを閉じる必要があるのではなく、ユーザーが選択を行った後にマスターテーブルビューを画面から移動しようとしています。
以下のコードを使用しています。コードのコメントが示すように、マスター サイド テーブル ビューの代わりに半透明の「影」が残ります。マスターサイドテーブルビューを画面から完全に移動するには、他に何をする必要がありますか.
- (void)hideSidebarNavPanel
{
/* This almost works - in that it moves the table view off the screen but leaves a "shadow" in its place.
This occurs whether we modify the frame for the tabBarView or the masterTableView or the masterView - or for all 3.
It seems that there is something else sitting below both of these that also needs to have its frame modified.
The question is what?
*/
UIView *masterView = self.view;
CGRect masterViewFrame = masterView.frame;
masterViewFrame.origin.x -= masterViewFrame.size.width;
NSArray *controllers = self.splitViewController.viewControllers;
UITabBarController *tabBarController = [controllers objectAtIndex:0];
UIView *tabBarView = tabBarController.view;
CGRect tabBarFrame = tabBarView.frame;
tabBarFrame.origin.x -= tabBarFrame.size.width;
// UIViewController *masterNavigationController = [tabBarController.viewControllers objectAtIndex:0];
// UIView *masterTableView = masterNavigationController.view;
// CGRect masterTableViewFrame = masterTableView.frame;
// masterTableViewFrame.origin.x -= masterTableViewFrame.size.width;
[UIView beginAnimations:@"showView" context:NULL];
masterView.frame = masterViewFrame;
tabBarView.frame = tabBarFrame;
//masterTableView.frame = masterTableViewFrame;
[UIView commitAnimations];
}