如何在iOS中的UISplitViewController中隐藏MasterView

时间:2015-06-25 13:38:17

标签: ios hide uisplitviewcontroller

当我触摸已在detailview中添加的webview时,我想隐藏景观中的主视图

我在C#中使用Xamarin.iOS,但我不能这样做..

https://forums.xamarin.com/discussion/3578/uisplitview-comes-up-in-landscape-with-master-view-hidden

我跟着这里..但它没有帮助我..

当我触摸详细视图的屏幕时如何隐藏显示..

1 个答案:

答案 0 :(得分:0)

在需要detialView diplay时添加此方法AppDelegate.m和用户。

-(void)setDetailView:(int)num ListofArray :(NSArray *)arr didSelectViewController:(UIViewController *)viewController diffClassId:(NSString *)strId
    {
        if ([viewController isKindOfClass:[DetailViewController class]])
        {
            DetailViewController *viewDetail = [[DetailViewController alloc] initWithArticle:num inArticlesArray:arr];
            viewDetail.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem;
            viewDetail.navigationItem.leftItemsSupplementBackButton = NO;

            detailNav=[[UINavigationController alloc]initWithRootViewController:viewDetail];
            //detailNav=[detailNav initWithRootViewController:viewDetail];

            NSArray *viewControllers = [[NSArray alloc] initWithObjects:mainNavController, detailNav, nil];
            splitViewController.viewControllers=viewControllers;
    }