ios 动画 隐藏tabbar_UITabBarViewController 的底部 tabBar 隐藏

iOS pushViewController 时候隐藏 TabBar 的可以用@interfaceUIViewController (UINavigationControllerItem)

@property(nonatomic,readonly,strong)UINavigationItem*navigationItem;// Created on-demand so that a view controller may customize its navigation appearance.

@property(nonatomic)BOOL hidesBottomBarWhenPushed __TVOS_PROHIBITED;// If YES, then when this view controller is pushed into a controller hierarchy with a bottom bar (like a tab bar), the bottom bar will slide out. Default is NO.

这是系统提供的 UINavigationViewController 的方法。你只需要在被push 的 UIViewcontroller 的初始化方法中添加这个属性就行。self.hidesBottomBarWhenPushed = YES;

这样有2个问题

1. 是做 pushViewController transition 过渡的时候,动画中会看到 tabBar 被移出去,尤其是被push 的viewController 的背景色反差很大的时候,体验很差。

2. presentViewController 的时候无法使用这个方法。

解决方法:

自己控制 UITabBarViewController 的 bottom tabBar。setFrame的方法控制。- (void)hideTabBar {

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值