0

I'm using a UITabBarController with UINavigationControllers like this

enter image description here

I add this to the view using

tabctrl.view.frame = CGRectMake(0, 0, 320, 548);
[self.view addSubview:tabctrl.view];

The screen looks like

enter image description here

But I can't switch to other tab(ie, touching on tabctrl's tab has no response)

If I change the frame like

tabctrl.view.frame = CGRectMake(0, 0, 320, 488);

then the screen looks like,

enter image description here

Now, I can touch the tab and switch to required viewcontroller. How to solve this issue?

I need to get access to the tabctrl when its frame height is 568.

I'm using xcode 4.6.2 and ios simulator 4inch retina.

4

3 回答 3

2

使用此代码:

 [appDelegate.window setRootViewController:tabctrl];

而不是:

tabctrl.view.frame = CGRectMake(0, 0, 320, 568);
[self.view addSubview:tabctrl.view];
于 2013-06-24T07:49:40.220 回答
1

将 rootViewController 的 WantsFullScreenLayout 属性设置为 YES

tabbarController.wantsFullScreenLayout = YES

这应该可以解决您在 4 英寸屏幕上的标签栏切换问题

于 2013-06-24T08:20:37.427 回答
1

您的标签栏控制器可能位于屏幕底部的其他内容后面。您可以使用代码对其进行测试:

[self.view bringSubviewToFront: tabctrl]

如果这解决了您的问题,请尝试查找标签栏控制器前面的视图

于 2013-06-24T07:39:11.857 回答