【swift】显示与隐藏tabBar

xiaoxiao2021-02-28  105

/// 是否隐藏tabbar /// /// - Parameter hiden: 是否隐藏 func hiddenTabar(hidden : Bool,con:UIViewController){ for subview in con.tabBarController!.view.subviews { if(subview.isKind(of: UITabBar.self)){ if(hidden){ subview.backgroundColor = UIColor.red subview.frame = CGRect(x: subview.frame.origin.x, y: UIScreen.main.bounds.size.height, width: subview.frame.size.width, height: subview.frame.size.height) con.view.frame.size.height = UIConfigure.Height - 64 }else{ subview.backgroundColor = UIColor.brown subview.frame = CGRect(x: subview.frame.origin.x, y: UIScreen.main.bounds.size.height - 49, width: subview.frame.size.width, height: subview.frame.size.height) con.view.frame.size.height = UIConfigure.Height - 64 - 49 } } } }
转载请注明原文地址: https://www.6miu.com/read-79595.html

最新回复(0)