小编Nih*_*iya的帖子

当 tableview 在 swift 4 中滚动时隐藏选项卡栏

I have view controller with tableview when i scroll tableview i want to hide tab bar in view controller. i have tried below code its working but top label went minus position of origin Y

extension UITabBarController {
    func setTabBarVisible(visible:Bool, duration: TimeInterval, animated:Bool) {
    if (tabBarIsVisible() == visible) { return }
    let frame = self.tabBar.frame
    let height = frame.size.height
    let offsetY = (visible ? -height : height)

    // animation
    if #available(iOS 10.0, *) {
        UIViewPropertyAnimator(duration: duration, curve: .linear) {
            self.tabBar.frame.offsetBy(dx:0, …
Run Code Online (Sandbox Code Playgroud)

tabbar swift

4
推荐指数
1
解决办法
2957
查看次数

标签 统计

swift ×1

tabbar ×1