導(dǎo)航工具欄庫Navigation Toolbar
發(fā)布時間:2018-08-20 17:02 回復(fù):0 查看:6497 感興趣:366 贊:8 最后回復(fù):2018-08-20 17:02
示例代碼:
class ViewController: UIViewController {
private var navigationView: NavigationView?
override func viewDidLoad() {
super.viewDidLoad()
navigationView = NavigationView.init(frame: view.bounds,
middleView: MiddleView(),
screens: [
ScreenObject(title: "MUSIC",
startColor: .red,
endColor: .blue,
image: UIImage(named : "image1")!,
controller: YourFirstViewController()),
ScreenObject(title: "EDUCATION",
startColor: .black,
endColor: .white,
image: UIImage(named : "image2")!,
controller: YourSecondViewController()),
],
backgroundImage: #imageLiteral(resourceName: "background"))
navigationView?.autoresizingMask = [.flexibleWidth, .flexibleHeight]
view.addSubview(navigationView!)
}
}