Open chunxige opened 1 year ago
我是写一个子类继承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")
}
}
I want it too. please