XLPagerTabStrip icon indicating copy to clipboard operation
XLPagerTabStrip copied to clipboard

buttonBarItemsShouldFillAvailiableWidth issue when we use larger font sizes

Open Ta7an opened this issue 9 years ago • 4 comments

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 <around 20-30 points> 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

Ta7an avatar May 17 '16 13:05 Ta7an

@Ta7an hi, have you solved this issue?

ludoded avatar Jun 22 '16 16:06 ludoded

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

kahopoon avatar Jun 30 '16 04:06 kahopoon

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.

AhonVashibaka avatar Jul 11 '16 07:07 AhonVashibaka

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

ElectroBuddha avatar Jul 27 '16 10:07 ElectroBuddha