【问题标题】:Buttons on the new presented view are not working when we use presentModalViewController当我们使用 presentModalViewController 时,新呈现视图上的按钮不起作用
【发布时间】:2013-01-08 07:51:26
【问题描述】:

当我使用 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 效果很好。

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

【问题讨论】:

    标签: iphone objective-c presentmodalviewcontroller ibaction


    【解决方案1】:

    试试这个...

      [self.navigationController presentModalViewController:prefDetails animated:YES]; instead of 
       [self presentModalViewController:prefDetails animated:YES];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多