iOS5 设备上的黑色 TabBar
如果我在 iOS5 下运行我的应用程序,一切似乎都很好。但是,如果我尝试加载带有 TabBar 的视图和其中的一些视图。
屏幕看起来实际上如下图所示,因此黑色选项卡栏和应该在屏幕上的选项卡栏的第一个子视图被释放。我假设视图和选项卡栏之间的绑定不存在。
所以我认为这与我如何将视图与标签栏链接起来有关。
它的工作原理是这样的:
NSMutableArray* controllersForHome = [[self.tabBarController.viewControllers mutableCopy] autorelease];
[controllersForHome insertObject:somveViewController atIndex:[controllersForHome count]];
[self.tabBarController setViewControllers:controllersForHome];
[someViewController release];
我读过在索引 >0 处插入对象应该会有帮助,但不幸的是在我的情况下没有。还是同样的问题。
有人猜测并可以给我提示如何解决这个问题吗?
谢谢,
Andreas
if I run my app under iOS5 all seems to be fine. But if I try to load a view with a TabBar and some views in it.
The screen looks actually like the picture below, so a black tabbar and the first subview of the tabbar which should be onscreen is deallocated. I assume, that the binding between the view and the tabbar does not exist.
So I think it has something to do how I link the views with the tabbar.
It works like that:
NSMutableArray* controllersForHome = [[self.tabBarController.viewControllers mutableCopy] autorelease];
[controllersForHome insertObject:somveViewController atIndex:[controllersForHome count]];
[self.tabBarController setViewControllers:controllersForHome];
[someViewController release];
I've read that inserting the object at an index >0 should be helpful, but unfortunately not in my case. Still the same issue.
Has somebody a guess and can give me a hint how to solve that problem?
Thanks,
Andreas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是我在 iOS 5 中解决问题的方法:
不要使用这个:
你应该使用这个:
this is how I solved the problem in iOS 5:
Instead of using this:
You should use this: