Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please support indicator fixed width #687

Open
chunxige opened this issue Aug 18, 2023 · 2 comments
Open

please support indicator fixed width #687

chunxige opened this issue Aug 18, 2023 · 2 comments

Comments

@chunxige
Copy link

No description provided.

@Toj-dev
Copy link

Toj-dev commented May 23, 2024

I want it too. please

@Toj-dev
Copy link

Toj-dev commented May 23, 2024

我是写一个子类继承PagingIndicatorView, 设置 options.indicatorColor = .clear
子类里包含一个子视图固定宽度

class SLPagingIndicatorView: PagingIndicatorView {

static var indicatorWidth: CGFloat = 24.ui_mscale
static var indicatorHeight: CGFloat = 2
static var indicatorColor = "#FF9900".to_color

private lazy var indicatorView: UIView = {
    let view = UIView()
    view.backgroundColor = Self.indicatorColor
    return view
}()

override init(frame: CGRect) {
    super.init(frame: frame)
    addSubview(indicatorView)
    indicatorView.snp.makeConstraints { make in
        make.center.equalToSuperview()
        make.height.equalTo(Self.indicatorHeight)
        make.width.equalTo(Self.indicatorWidth)
    }
}

required init?(coder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants