Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TabBar layout ignores vertical separators width #563

Closed
3 tasks done
stefanomondino opened this issue Mar 20, 2021 · 1 comment · Fixed by #564
Closed
3 tasks done

TabBar layout ignores vertical separators width #563

stefanomondino opened this issue Mar 20, 2021 · 1 comment · Fixed by #564

Comments

@stefanomondino
Copy link
Contributor

stefanomondino commented Mar 20, 2021

New Issue Checklist

Issue Description

When using separators in TabBar (TMConstrainedHorizontalBarLayout), the inner stack view is applying a width constraint on both items and separators, ignoring the separator's width.

This results in button items and separators having the same width, which is not the intended behavior.

This can easily be reproduced by changing provided example with this snippet in TabViewController.swift instead of ButtonBar in viewDidLoad

 // Create a bar
        let bar = TMBarView.TabBar()
        
        // Customize bar properties including layout and other styling.
        bar.layout.contentInset = UIEdgeInsets(top: 0.0, left: 16.0, bottom: 4.0, right: 16.0)
//        bar.layout.interButtonSpacing = 24.0
//        bar.indicator.weight = .light
//        bar.indicator.cornerStyle = .eliptical
        bar.fadesContentEdges = true
        bar.spacing = 16.0
        
        bar.layout.separatorWidth = 1
        bar.layout.showSeparators = true

    bar.buttons.customize {
            $0.tintColor = UIColor.tabmanForeground.withAlphaComponent(0.4)
            $0.selectedTintColor = .tabmanForeground
            if #available(iOS 11, *) {
                $0.adjustsFontForContentSizeCategory = true
            }
        }
        bar.indicator.tintColor = .tabmanForeground
        
        // Add bar to the view - as a .systemBar() to add UIKit style system background views.
        addBar(bar.systemBar(), dataSource: self, at: .top)

Other useful things

simulator_screenshot_3EA81E10-D61E-49B0-9AA5-5DB70B4D7756

@msaps
Copy link
Member

msaps commented Mar 30, 2021

@stefanomondino now available in 2.11.1 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants