Yalantis/Segmentio

set indicator ratio not work.

Closed this issue · 1 comments

git tag:3.1
set indicator ratio not work.

my code:

        let indicatorColor = UIColor.red
        let indicatorOptions = SegmentioIndicatorOptions(type: .bottom, ratio: 0.6, color: indicatorColor)
        let normalTitleColor = UIColor.blue
        let normalState = SegmentioState(backgroundColor: .clear, titleFont: UIFont.systemFont(ofSize: 15), titleTextColor: normalTitleColor)
        let selectedState = SegmentioState(backgroundColor: .clear, titleFont: UIFont.systemFont(ofSize: 17), titleTextColor: .black)
        let segmentStates = (defaultState: normalState,
                             selectedState: selectedState,
                             highlightedState: normalState)
        
        let options = SegmentioOptions(backgroundColor: .white, segmentPosition: .fixed(maxVisibleItems: 2), scrollEnabled: false, indicatorOptions: indicatorOptions, labelTextNumberOfLines: 1, segmentStates: segmentStates)
        let items = ["密码登录", "验证码登录"].map { title in
            SegmentioItem(title: title, image: nil)
        }
        semo.setup(content: items, style: .onlyLabel, options: options)
        semo.selectedSegmentioIndex = 0
rnkyr commented

hey, @plumhly

I've just run your code in the example project. looks like it works just fine

image