xmartlabs/XLPagerTabStrip

Vertically Centralising text in BarButtonView

Aberta

#411 aberto em 4 de jul. de 2017

 (2 comentários) (2 reações) (0 responsável)Swift (1.319 forks)batch import
help wanted

Métricas do repositório

Stars
 (6.965 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

What is the best way of vertically centralising the text of each collection view cell?

Here are my settings

`settings.style.buttonBarItemLeftRightMargin = 20 settings.style.buttonBarItemsShouldFillAvailableWidth = false settings.style.buttonBarItemFont = .systemFont(ofSize: 13, weight: 0.1) settings.style.buttonBarItemTitleColor = UIColor(red:255/255.0, green:255/255.0, blue:255/255.0, alpha:0.8)

    settings.style.buttonBarBackgroundColor = UIColor(red:255/255.0, green:255/255, blue:255/255.0, alpha:1.0)
    settings.style.buttonBarItemBackgroundColor = UIColor(red:255/255.0, green:255/255.0, blue:255/255.0, alpha:1.0)
    settings.style.selectedBarBackgroundColor = UIColor(red:32/255.0, green:163/255.0, blue:213/255.0, alpha:1.0)
    settings.style.selectedBarHeight = 2
    
    settings.style.buttonBarMinimumLineSpacing = 0
    settings.style.buttonBarLeftContentInset = 20
    settings.style.buttonBarRightContentInset = 20
    changeCurrentIndexProgressive = { [weak self] (oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void in
        guard changeCurrentIndex == true else { return }
        oldCell?.label.textColor = self?.nonSelectedColor
        newCell?.label.textColor = self?.selectedColor
        oldCell?.label.font = self?.nonSelectedFont
        newCell?.label.font = self?.selectedFont
    }`

Here is a screenshot, i want to make the gap between the text and the indicator smaller

new screen

Guia do colaborador