Commit ded81b48 by Orkhan Alikhanov

Fixed setting tabBarAlignment does not update line/divider alignment

parent 0b14b2a5
...@@ -167,6 +167,7 @@ open class TabsController: TransitionController { ...@@ -167,6 +167,7 @@ open class TabsController: TransitionController {
/// The tabBar alignment. /// The tabBar alignment.
open var tabBarAlignment = TabBarAlignment.bottom { open var tabBarAlignment = TabBarAlignment.bottom {
didSet { didSet {
updateTabBarAlignment()
layoutSubviews() layoutSubviews()
} }
} }
...@@ -326,10 +327,14 @@ fileprivate extension TabsController { ...@@ -326,10 +327,14 @@ fileprivate extension TabsController {
/// Prepares the TabBar. /// Prepares the TabBar.
func prepareTabBar() { func prepareTabBar() {
tabBar.lineAlignment = .bottom == tabBarAlignment ? .top : .bottom
tabBar.dividerAlignment = .bottom == tabBarAlignment ? .top : .bottom
tabBar._delegate = self tabBar._delegate = self
view.addSubview(tabBar) view.addSubview(tabBar)
updateTabBarAlignment()
}
func updateTabBarAlignment() {
tabBar.lineAlignment = .bottom == tabBarAlignment ? .top : .bottom
tabBar.dividerAlignment = .bottom == tabBarAlignment ? .top : .bottom
} }
/// Prepares the `tabBar.tabItems`. /// Prepares the `tabBar.tabItems`.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment