// // MPCustomTabBar.swift // MusicPlayer // // Created by Mr.Zhou on 2024/3/27. // import UIKit ///自定义taBar class MPSideA_CustomTabBar: UITabBar { //tabBarView fileprivate lazy var tabBarView:MPSideA_CustomTabBarView = { let tabBarView:MPSideA_CustomTabBarView = .instanceFromNib() return tabBarView }() override init(frame: CGRect) { super.init(frame: frame) self.addSubview(tabBarView) backgroundColor = .clear tabBarView.snp.makeConstraints { make in make.left.right.bottom.equalToSuperview() make.height.equalTo(72*width) } } override func layoutSubviews() { super.layoutSubviews() //将tabBarView置于顶层 self.bringSubviewToFront(tabBarView) } required init?(coder: NSCoder) { super.init(coder: coder) } }