XLPagerTabStrip icon indicating copy to clipboard operation
XLPagerTabStrip copied to clipboard

Is there anyway to change selectedBar width?

Open ubersexual opened this issue 4 years ago • 3 comments

Hi . Is there anyway to change selectedBar width? I want a shorter selectbar

ubersexual avatar Jul 01 '20 07:07 ubersexual

You can add a custom selected bar like this:

        let rect = CGRect(x: 0, y: 0, width: 16, height: 2)
        let customSelectedBar = ShapeView(frame: rect)
        customSelectedBar.shapeLayer.path = UIBezierPath(roundedRect: rect, cornerRadius: 2).cgPath
        customSelectedBar.shapeLayer.fillColor = Color.primaryColor.cgColor
        buttonBarView.selectedBar.addSubview(customSelectedBar)
        customSelectedBar.snp.makeConstraints {
            $0.size.equalTo(rect.size)
            $0.centerX.bottom.equalToSuperview()
        }

WessonWu avatar Jul 14 '20 06:07 WessonWu

you can override "updateSelectedBarPosition" the function of ButtonBarView. Adjust the "selectedBarFrame.size.width = selectedCellFrame.size.width" and "selectedBarFrame.origin.x = selectedCellFrame.origin.x". 截屏2020-11-25 下午12 28 12

HKevin1993 avatar Nov 25 '20 04:11 HKevin1993

Have any progerss?

RealFeeling avatar Jan 06 '21 04:01 RealFeeling