【问题标题】:switch views using a button, going to a table view, iphone使用按钮切换视图,转到表格视图,iphone
【发布时间】:2010-05-26 00:03:27
【问题描述】:

我的程序有 4 个按钮,每个按钮调用不同的表格视图。这很好用,但我的问题是,我使用的视图控制器显示了一个表格视图,它覆盖了我的导航栏和标签栏。我需要用可以打开表格而不掩盖我的导航栏和标签栏的东西替换该编码。这是我正在使用的编码: -(IBAction)buttonNorthWest {

NorthWestViewController *nwController = [[NorthWestViewController alloc] initWithNibName:@"NorthWestView" bundle:nil];
self.nwViewController = nwController;
[self.view insertSubview:nwViewController.view atIndex:0];


[self presentModalViewController:nwViewController animated:YES];


[nwController release];

}

[self presentModalViewController....] 是问题所在。有谁知道如何用保留导航栏和标签栏的东西替换该代码?

谢谢, 詹姆

【问题讨论】:

  • 你有这方面的最新消息吗?

标签: iphone uiview button tableview


【解决方案1】:

在 iPhone 上,所有模态视图控制器必须全屏显示,如http://developer.apple.com/iphone/library/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle

作为替代方案,您可以将 tableview 显示为子视图并调整框架,使其不与导航或工具栏重叠。

【讨论】:

  • 对不起,我已经离开了,所以很长一段时间没有对这段代码做任何事情。非常感谢您的回复,并将尝试使用子视图。
  • 没问题。如果您还有其他问题,请告诉我。我很乐意提供帮助。
猜你喜欢
  • 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
相关资源
最近更新 更多