Xlpagertabstrip: buttonBarItemsShouldFillAvailiableWidth issue when we use larger font sizes

Created on 17 May 2016  路  4Comments  路  Source: xmartlabs/XLPagerTabStrip

I have a four tabs button bar view with font size 14.0, tabs fit text in buttons and all of them are aligned to left and a space is plain on the right side in the button bar view

Here is code:

        settings.style.selectedBarBackgroundColor = UIColor.whiteColor()

        // each buttonBar item is a UICollectionView cell of type ButtonBarViewCell
        settings.style.buttonBarItemBackgroundColor = UIColor.clearColor()

        if let font = UIFont(name: "DroidArabicKufi", size: CGFloat(14.0)) {
            settings.style.buttonBarItemFont = font
        }
        // helps to determine the cell width, it represent the space before and after the title label
        //        settings.style.buttonBarItemLeftRightMargin: CGFloat = 8
        settings.style.buttonBarItemTitleColor = UIColor.whiteColor()
        // in case the barView items do not fill the screen width this property stretch the cells to fill the screen
        settings.style.buttonBarItemsShouldFillAvailiableWidth = true

discussion

Most helpful comment

i have the same problem too that align all things at left and blank at right, after i try to look at the Button Bar View in storyboard, it has the default value of cell size 's width and height, spacing bla bla bla, i put their value at all 0, problem solved for me
screen shot 2016-06-30 at 12 25 19

All 4 comments

@Ta7an hi, have you solved this issue?

i have the same problem too that align all things at left and blank at right, after i try to look at the Button Bar View in storyboard, it has the default value of cell size 's width and height, spacing bla bla bla, i put their value at all 0, problem solved for me
screen shot 2016-06-30 at 12 25 19

Tried method that kahopoon suggested and my XCode hanged up twice. The reason was that I leaved Cell Width equal to 50 and changed to zero all other fields. When I make all fields equal to zero, beginning with Cell Height, all was ok. So be careful with that magic :) Had send report to Apple, so let us hope they will correct this bug.

I had this issue on iPad. I can confirm that kahopoon's suggestion also solved this problem for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nikhil191090 picture nikhil191090  路  5Comments

dkononenko picture dkononenko  路  4Comments

fenixsolorzano picture fenixsolorzano  路  4Comments

dowhilenet picture dowhilenet  路  4Comments

JorgeAGomez picture JorgeAGomez  路  4Comments