How do I hide/show tabBar when tapped using Swift in iOS8

后端 未结 10 1030
终归单人心
终归单人心 2020-12-04 12:44

I am trying to mimic the UINavigationController\'s new hidesBarsOnTap with a tab bar. I have seen many answers to this that either point to setting the hi

10条回答
  •  死守一世寂寞
    2020-12-04 13:21

    To make the animations work with self.tabBarController?.tabBar.hidden = true just do this:

    UIView.animateWithDuration(0.2, animations: {
        self.tabBarController?.tabBar.hidden = true
    })
    

    Other than the other solution this will also work nicely with autolayout.

提交回复
热议问题