1

当我使用presentModalViewController时按钮操作不起作用

在视图 1 中:

-

(void)PreseentTheNextView
    {
        NSLog(@"clicked to add the new view from botom to top");
        PreferenceViewController *prefDetails=[[PreferenceViewController alloc] initWithNibName:@"PreferenceViewController" bundle:nil];
        [self presentModalViewController:prefDetails animated:YES];
    }

我在PreferenceViewController上有两个按钮

在视图 2 中:

-(IBAction)button1Click
{
NSLog(@"Button 1 Clicked");
}


-(IBAction)button2Click
{
 NSLog(@"Button 2 Clicked");
}

-(IBAction)DismissButton
    {
     NSLog(@"Remove/ Dismiss down the view to previus page ");
    }

所有这些按钮都设置在 PreferenceViewController 的 IB 中。

当我使用presentModalViewController时,这些按钮操作不起作用

如果我使用Navigation PushViewController并且工作正常。

但我们的要求只是呈现从下到上的视图

4

1 回答 1

4

尝试这个...

  [self.navigationController presentModalViewController:prefDetails animated:YES]; instead of 
   [self presentModalViewController:prefDetails animated:YES];
于 2013-01-08T08:02:56.670 回答