xmartlabs / XLPagerTabStrip

Android PagerTabStrip for iOS.
MIT License
6.97k stars 1.32k forks source link

ButtonBarView Tabs not centered when right tabs are selected #811

Closed grantespo closed 3 years ago

grantespo commented 3 years ago

When, i first load my ButtonBarPagerTabStripViewController with 4 tabs, it looks perfect.

Screen Shot 2020-11-19 at 6 17 13 PM

However, when I select the 3rd or 4th tab, my ButtonBarView Tabs become aligned to the left.

Screen Shot 2020-11-19 at 6 17 23 PM

How can I ensure that the tabs are always centered?

Here are my settings:


        settings.style.buttonBarItemBackgroundColor = whiteBlackColor
        settings.style.selectedBarBackgroundColor = selectedMenuColor
        settings.style.buttonBarItemFont = .boldSystemFont(ofSize: 14)
        settings.style.selectedBarHeight = 2.0
        settings.style.buttonBarMinimumLineSpacing = 0
        settings.style.buttonBarItemTitleColor = unselectedMenuColor
        settings.style.buttonBarItemsShouldFillAvailableWidth = true
        settings.style.buttonBarLeftContentInset = 0
        settings.style.buttonBarRightContentInset = 0`
grantespo commented 3 years ago

In view.DidLoad():

 buttonBarView.contentOffset = CGPoint(x: 0, y: 0)