【发布时间】:2011-08-24 03:23:16
【问题描述】:
我正在开发一个简单的基于视图的 iPhone 应用程序。 从应用程序的主屏幕,您可以导航到 4 个不同的视图。 其中一个视图包含一个标签栏。 因为这不是正常的方法,所以我使用了没有 UITabController 的解决方法。
为了做到这一点,我使用了这个主题: https://discussions.apple.com/thread/2099944?start=0&tstart=0
还有这个示例代码: http://pymbian.svn.sourceforge.net/svnroot/pymbian/stuff/testtab_raynewbie/Classes/
通过一些小的修改,这可以工作。 当我想从标签视图返回主视图时,只有我有最后一个错误,标签栏停留在屏幕底部。
我尝试了这里描述的几种方法。
myTabBar.hidden = YES
hidesBottomBarWhenPushed = YES
但似乎没有一个有效.... 我认为问题出在视图 UI 控制器的奇怪结构中。因为现在的结构是这样的。
MainViewController
- ViewController with TabBar
- tab1viewcontroller
- tab2viewcontroller
- other viewcontrollers
返回主视图是在 tab1viewcontroller 中完成的,我无法对 TabBar 做任何事情。在所有其他视图中,我使用此代码返回:
-(IBAction) BackAction:(id)sender {
mainControllerView = [[MainControllerView alloc] initWithNibName:@"MainControllerView" bundle:nil];
[self.view addSubview:mainControllerView.view];
[mainControllerView.view release];
}
谁有想法?
【问题讨论】:
-
我有同样的问题。你有什么解决办法吗?如果你知道任何事情请解释一下。
标签: iphone objective-c xcode view tabbar