0

我正在向主视图控制器添加一个 tabbarcontroller。如果我触摸标签栏图像徽标下方的标题,它不会响应。如果我单击选项卡栏的图像,则会单击并选中它。此问题仅适用于 iPhone 5(4 英寸屏幕)。但它在 3.5 英寸设备上运行良好。

请参考下图,红色边框内的区域不会响应所有标签栏的触摸。

在此处输入图像描述

两个设备 awa 模拟器中都会出现同样的问题。我记得 StackOverflow 中有一篇带有完整标签栏点击访问的帖子,但现在找不到。请为此提出解决方案。

4

2 回答 2

1
in Main View Controller

-(void) viewDidAppear:(BOOL)animated
{
  [super viewDidAppear:animated];

    // I assumed that you have created yourTabBarController in View did load

    yourTabBarController.view.frame = self.view.bounds;

}
于 2014-03-07T06:38:11.753 回答
1

编辑

根据您的评论

I added the tabbarcontroller using, tabctrl.view.frame = CGRectMake(0, 20, 320, 548); [self.view addSubview:tabctrl.view];

您还应该使用窗口边界或 self.view 初始化 tabBar 或尝试不设置视图,tabbar 将自行设置

上一个答案

在实用程序检查器中为 MainWindow 启用全屏 在此处输入图像描述

于 2014-03-07T06:26:31.927 回答