Ios Tabbar控制器隐藏操作后UiButton的失去接触检测
我正在编写一个带有tabbarcontroller的应用程序,其中包含一些NavigationViewController。每个NavigationController都包含一些ViewController。有时在导航过程中,我需要隐藏选项卡栏,我使用的代码是:Ios Tabbar控制器隐藏操作后UiButton的失去接触检测,ios,iphone,uitabbarcontroller,uitabbar,Ios,Iphone,Uitabbarcontroller,Uitabbar,我正在编写一个带有tabbarcontroller的应用程序,其中包含一些NavigationViewController。每个NavigationController都包含一些ViewController。有时在导航过程中,我需要隐藏选项卡栏,我使用的代码是: - (void) hideTabBar:(UITabBarController *) tabbarcontroller { for(UIView *view in tabbarcontroller.view.subviews)
- (void) hideTabBar:(UITabBarController *) tabbarcontroller {
for(UIView *view in tabbarcontroller.view.subviews)
{
if([view isKindOfClass:[UITabBar class]])
{
[view setFrame:CGRectMake(view.frame.origin.x, [self ScreenHeight], view.frame.size.width, view.frame.size.height)];
}
else
{
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, [self ScreenHeight])];
}
}
}
在我尝试在屏幕底部添加一个按钮之前,一切都很好。我无法触摸屏幕底部的按钮,tabbar已正确隐藏且按钮可见。。。如果我向上移动按钮,它将返回正常工作状态…选项卡栏似乎从未移出屏幕。。。我该怎么办 我已经用你的代码完成了,它非常适合我
说明
使用OP和
屏幕
试试这个
ViewController* vC = [[ViewController alloc] init];
vC.hidesBottomBarWhenPushed = YES;
并确保该按钮处于最高级别。在您的情况下,底部工具栏隐藏按钮什么[self AltezzaSchermo]将返回对不起,我已经编辑了我的问题。它返回屏幕的高度,480或568…这对我来说很有用尝试这里如果你添加了按钮运行时,那么请添加该代码,我也尝试了你的代码对我来说很有用。无论如何,这个例子和我的应用程序之间有很多不同。。。自动布局,该功能插入到应用程序代理中,my直接插入到viewcontroller中。。。我想我无法将may应用程序与示例进行正确的比较。然而thanks@user31929若我知道你们在做什么来解决这个问题,那个就太好了,你们能分享一下你们的工作吗?