【问题标题】:How to remove SWRevealViewController?如何删除 SWRevealViewController?
【发布时间】:2013-12-09 16:24:38
【问题描述】:

我在我的 iPhone 应用中使用SWRevealViewController

成功登录后,我正在从我的视图控制器创建 SWRevealViewController。

        profileView *frontViewController = [[profileView alloc] init];
        RearViewController *rearViewController = [[RearViewController alloc] init];

        UINavigationController *frontNavigationController = [[UINavigationController alloc] initWithRootViewController:frontViewController];
        UINavigationController *rearNavigationController = [[UINavigationController alloc] initWithRootViewController:rearViewController];

        SWRevealViewController *revealController = [[SWRevealViewController alloc] initWithRearViewController:rearNavigationController frontViewController:frontNavigationController];
        revealController.delegate = self;



       frontViewController.user_id = [defaults objectForKey:@"userid"];
        appDelegate.user_id = [defaults objectForKey:@"userid"];
        [self.navigationController pushViewController:revealController animated:YES];

现在我想退出并返回视图控制器。我尝试了 poptoRootviewcontroller,但没有工作。如何做到这一点?

【问题讨论】:

    标签: ios iphone objective-c ipad slider


    【解决方案1】:

    试试这个 - 从你的前/后视图控制器调用:

    [self.revealViewController.navigationController popViewControllerAnimated:YES];
    

    【讨论】:

      【解决方案2】:

      在您的操作中尝试此代码:

      ViewController *vc = [[ViewController alloc]init];
              UINavigationController *nvc = [[UINavigationController alloc]initWithRootViewController:vc];
      
              [reveal pushFrontViewController:nvc animated:YES];
      

      【讨论】:

        猜你喜欢
        • 2017-12-04
        • 2015-06-14
        • 2014-04-03
        • 2014-10-08
        • 2017-03-27
        • 2018-01-04
        • 2017-05-06
        • 2016-11-15
        • 2016-06-02
        相关资源
        最近更新 更多