`
lizhuang
  • 浏览: 900267 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

hidesBottomBarWhenPushed处理方案

阅读更多

1
down vote
Not sure if a solution was found for this but I just managed to get this working.

My scenario:

I have a UITabBarController with 4 tab bar items. On one of the tab bar items it loads a UIViewController with buttons on it. The buttons calls a IBOutlet function that loads another UIViewController which contains the a tab bar at the bottom.

After many trial & error........

On the IBOutlet function, I do the following:

{
self.hidesBottomBarWhenPushed = YES;
/* Push the new controller with tab bar */
}
This was working fine with the UITabBarController's tab bar sliding to the left and my tab bar from the pushed controller sliding from the right.

Obviously from functionality perspective I need to push the initial UITabBarController's tar bar back in when "going back".

After many trial & error........

I have the method viewWillDisappear in the UIViewController that pushes the UIViewController with tab bar as:

- (void) viewWillDisappear:(BOOL)animated
{
    self.hidesBottomBarWhenPushed = NO;
}
I ran a few quick tests on this in the simulator and it seems to work fine.

Some contributors suggests that this is bad UI but I am trying this out at the moment to see how it works out.

Happy to receive (cop) any feedbacks.
分享到:
评论

相关推荐

    iOS自定义Tabbar

    本文将深入探讨如何在iOS应用中实现自定义Tabbar,以及如何利用`hidesBottomBarWhenPushed`属性来控制页面推入时Tabbar的显示状态。 首先,让我们了解自定义Tabbar的基本步骤: 1. 创建TabbarController:在iOS...

    隐藏TabBar的一些方法小结

    如果希望全局控制TabBar的隐藏,可以重写NavigationController的`pushViewController:animated:`方法,统一处理隐藏逻辑: ```swift class CustomNavigationController: UINavigationController { override ...

    隐藏自定义tabbar

    1. 使用`hidesBottomBarWhenPushed`属性:在需要隐藏TabBar的ViewController中设置`self.hidesBottomBarWhenPushed = true`,这样在push这个ViewController时,TabBar会自动隐藏。当返回时,TabBar会重新显示。这种...

    高度自定义TabBarController组件ESTabBarController.zip

    hidesBottomBarWhenPushed = true , 第二种则不需要在ESTabBarController中,通过添加Container视图到UITabBar的方式来兼容这两种层级处理方式。6、支持自定义使用ESTabBarController可以实现:自定义选中颜色和样式...

    HideTabbar

    在iOS应用开发中,`HideTabbar`是一个常见的需求,特别...记住,良好的用户体验往往取决于这些细节处理,所以根据具体场景选择合适的方式至关重要。在实际开发中,还可以结合其他UI设计原则和用户反馈来优化这一功能。

    UITabBarController使用案例

    - 在某些场景下,可能需要隐藏TabBar,这可以通过设置`hidesBottomBarWhenPushed`属性为`true`来实现,或者在需要隐藏时调用`tabBarController?.tabBar.isHidden = true`。 7. **工具辅助** - 使用Xcode的...

    iOS界面跳转时导航栏和tabBar的隐藏与显示功能

    在iOS应用开发中,对导航栏和TabBar的隐藏与显示的处理可以提高应用的交互性和视觉效果。合理运用上述方法,可以在不影响其他页面显示的情况下,灵活地控制这两个组件的可见性。请确保在实际项目中根据需求适当调整...

    UISearchController Demo

    如果需要自定义这种行为,可以通过设置`hidesNavigationBarDuringPresentation`和`hidesBottomBarWhenPushed`属性。 2. 搜索栏样式: 可以设置searchController.searchBar的外观,例如改变文字颜色、背景色等。 3....

    自定义Tabbar

    这可以通过修改TabBarController的`hidesBottomBarWhenPushed`属性来实现。当导航控制器pushViewController时,如果设置该属性为true,则新push的控制器会隐藏Tabbar。若要恢复显示,可以在popViewController后重新...

    ZXing QRCode Scan

    wid_ctrl.hidesBottomBarWhenPushed = YES; NSURL *file_url = [[NSURL alloc] initFileURLWithPath:[NSString main_bundle_file_path:@"beep-beep.caf"]]; wid_ctrl.beep_url = file_url; [file_url release]; ...

    UITabBarController

    这可以通过调用`hidesBottomBarWhenPushed`属性在子控制器中实现,或者在代码中手动调整`tabBarController.tabBar.hidden`的值。 4. **选择器事件**: 当用户点击标签时,`UITabBarController`会发送`...

    StickyTabBarViewController:标签栏顶部的粘滞和可折叠视图

    只要在其顶部分配了粘性视图控制器,标签栏就可见(在任何时候推送的任何vc都不hidesBottomBarWhenPushed设置为true 。 安装 StickyTabBarViewController可通过和。 SPM安装:通过将其添加为新的软件包依赖项 ...

    buttonTouchEventTest:修复Button touchDown bug

    简单地说,在设置detailVC.hidesBottomBarWhenPushed = YES;之后,放一个view在tabbar原来的位置上,再在view上添加一个button,像这样为button添加touchDown action,当按住button的左下角区域时,action没有被触发...

    UITabBarController的使用

    这可以通过设置`hidesBottomBarWhenPushed`属性为`YES`来实现,通常在子控制器中进行设置。如果需要全局隐藏,可以修改`tabBarController.tabBar.hidden`的值。 6. **自定义选中状态** 除了基本的选中颜色,还可以...

    iOS开发中简单实用的几个小技巧

    以上这些技巧都是在iOS开发中经常会用到的,它们能帮助开发者更高效地处理一些常见的问题,提升开发体验。在实际项目中,灵活运用这些小技巧,会让你的代码更加简洁,同时也提高了代码的可读性和可维护性。

    iOS的UI开发中UITabBarControlle的基本使用教程

    - 在某些情况下,你可能需要隐藏或显示`TabBar`,这可以通过修改`hidesBottomBarWhenPushed`属性来实现。 综上所述,`UITabBarController`是构建底部标签栏界面的关键组件,通过它可以轻松地管理多个视图控制器,并...

    使用runtime 实现weex 跳转原生页面

    vc.hidesBottomBarWhenPushed = YES; // ... 属性设置 ... UIViewController *currentVC = [Utils getCurrentVC]; if ([currentVC isKindOfClass:[UINavigationController class]]) { [...

Global site tag (gtag.js) - Google Analytics