update support isTranslucent
This commit is contained in:
+12
-4
@@ -13,6 +13,7 @@ class ExampleAddCollectionViewController: StoryboardController {
|
||||
|
||||
var container: ContainerController!
|
||||
|
||||
@IBOutlet var btnChangeTranslucent: UIButton!
|
||||
// MARK: - Init
|
||||
|
||||
override func viewDidLoad() {
|
||||
@@ -20,6 +21,8 @@ class ExampleAddCollectionViewController: StoryboardController {
|
||||
|
||||
title = "Example Add CollectionView"
|
||||
|
||||
btnUpdateText()
|
||||
|
||||
let layoutC = ContainerLayout()
|
||||
layoutC.positions = ContainerPosition(top: 100, middle: 250, bottom: 70)
|
||||
container = ContainerController(addTo: self, layout: layoutC)
|
||||
@@ -31,21 +34,26 @@ class ExampleAddCollectionViewController: StoryboardController {
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
navigationController?.navigationBar.isTranslucent = true
|
||||
|
||||
container.move(type: .middle)
|
||||
}
|
||||
|
||||
@IBAction func buttonChangeTranslucent(_ sender: UIButton) {
|
||||
@IBAction func btnChangeTranslucentAction(_ sender: UIButton) {
|
||||
|
||||
guard let translucent = navigationController?.navigationBar.isTranslucent else { return }
|
||||
|
||||
navigationController?.navigationBar.isTranslucent = !translucent
|
||||
|
||||
btnUpdateText()
|
||||
|
||||
container.move(type: container.moveType)
|
||||
}
|
||||
|
||||
|
||||
func btnUpdateText() {
|
||||
|
||||
guard let translucent = navigationController?.navigationBar.isTranslucent else { return }
|
||||
|
||||
btnChangeTranslucent.setTitle("NavBar isTranslucent \(translucent)", for: .normal)
|
||||
}
|
||||
|
||||
func addCollectionView() -> UICollectionView {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user