2016-08-18 48 views
0

enter image description here enter image description here按钮动作时,不动于中,侧边栏emmended

当我按一下按钮,屏幕是不是改变了侧边栏嵌入另一个VC。我认为这是一个问题涉及到第二个控制器给出的类名SWRevealView控制器。

任何人都可以帮我解决这个问题吗?我的代码是:

- (IBAction)check:(id)sender { 

    SWRevealViewController *vc= [self.storyboard instantiateViewControllerWithIdentifier:@"dash"]; 
    [self presentViewController:vc animated:YES completion:nil]; 

} 
+0

你检查标识符吗? vc在这里没有? – Sofeda

+0

是的,它不是无..当我点击登录按钮,然后在SWRevealviewController的帮助下嵌入侧栏的屏幕画面不打开..刺激器只是打开和关闭 – Bansal

+0

你有导航控制器吗? – Sofeda

回答

0

我尝试了一个为你的问题的示例。它显示了揭示视图控制器使用按钮操作。

首先设置View Controller。然后设置Reveal View Controller。

Utilities->Click Identity Inspector->Go to Identity(It is below to Custom Class)->Give 'dash' in Storyboard ID 

首先截图显示视图控制器和显示视图控制器

enter image description here

然后我在故事板ID在ViewController.m

设置 '冲刺'

enter image description here

现在

- (IBAction)check:(id)sender 
{ 
    SWRevealViewController *vc= [self.storyboard instantiateViewControllerWithIdentifier:@"dash"]; 
    [self presentViewController:vc animated:YES completion:nil]; 
} 
+0

这是push..but的情况下,但我使用模态逻辑移动到另一个屏幕..在这个导航控制器是没有必要的 – Bansal

+0

首先请告诉我,我们可以给名称类SWRevealVIewController? – Bansal

+0

name class是什么意思? – user3182143