В моем XCode 4.2 я создал новый проект с разбитым представлением.
Затем в DetailViewController.m
файле я добавлю этот метод
- (BOOL)splitViewController: (UISplitViewController*)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation
{
//This method is only available in iOS5
return NO;
}
Теперь, делая это, я могу одновременно показывать как левую, так и правую часть моего контроллера splitview.
Теперь я добавил UIBarButtonItem
в моей панели навигации DetailViewController
, и я хочу, используя, с помощью которого я могу скрыть и показать мой главный вид как в режиме портрета, так и в ландшафтном режиме.
- (IBAction)hideUnhide:(id)sender
{
//How can hide & unhide
}
Как я могу это сделать?