Ios Uitabbarcontroller赢得';在iPhone5中触摸标签栏的标题时,我没有反应
我正在向主视图控制器添加一个tabbarcontroller。如果我触摸标签栏图像徽标下方的标题,它将不会响应。如果单击选项卡栏的图像,它会被单击并选中。本期仅为iPhone5(4英寸屏幕)。但它在3.5英寸的设备上运行良好 请参考下图,红色边框内的区域不会对所有选项卡栏的触摸做出响应 两个设备a.w.a模拟器中都出现相同的问题。我记得在StackOverflow中有一篇文章有完整的tabbar点击访问权限,但现在找不到。请对此提出解决方案 编辑 根据你的评论Ios Uitabbarcontroller赢得';在iPhone5中触摸标签栏的标题时,我没有反应,ios,cocoa-touch,user-interface,touch,uitabcontroller,Ios,Cocoa Touch,User Interface,Touch,Uitabcontroller,我正在向主视图控制器添加一个tabbarcontroller。如果我触摸标签栏图像徽标下方的标题,它将不会响应。如果单击选项卡栏的图像,它会被单击并选中。本期仅为iPhone5(4英寸屏幕)。但它在3.5英寸的设备上运行良好 请参考下图,红色边框内的区域不会对所有选项卡栏的触摸做出响应 两个设备a.w.a模拟器中都出现相同的问题。我记得在StackOverflow中有一篇文章有完整的tabbar点击访问权限,但现在找不到。请对此提出解决方案 编辑 根据你的评论 I added the tabb
I added the tabbarcontroller using, tabctrl.view.frame = CGRectMake(0, 20, 320, 548); [self.view addSubview:tabctrl.view];
还应使用窗口边界或self.view初始化选项卡栏
或者尝试不设置视图,tabbar会自行设置
先前的答复
在实用程序检查器中启用主窗口的全屏显示
您正在使用情节提要吗?或者是他们的主窗口。xib?@Kabira,我没有使用故事板。但是我的项目中没有主窗口。现在该怎么做?在项目中如何初始化窗口?在didfinishlaunching方法中,我添加了
self.window=[[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds];self.viewController=[[viewcontrolleralloc]initWithNibName:@“ViewControlleriPhone5”bundle:nil];self.window.rootViewController=self.viewController代码>我的项目中没有MAinwidow.xib文件。我只是将tabbarcontroller添加到该viewcontroller中代码>
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;
}