WKCSliderView
自定义滑块
WKCSliderView 适用于滑动范围较大的情况。例如:`WKCSliderView * sliderView = [[WKCSliderView alloc] initWithFrame:UIScreen.mainScreen.bounds];` 此时,整个屏幕内滑动,sliderView 都会响应。即:sliderView 的响应范围与其 frame 有关。注意:WKCSliderView 的 frame 并不是进度部分的坐标,后者需要单独设置。
属性列表
属性 | 含义 |
---|---|
delegate | 代理,处理值改变、滑动结束等回调事件 |
progressHandle | 值改变 block 回调,与代理不冲突 |
alignment | 水平对齐方式 |
horizontalMagin | 水平非居中时的边距 |
sliderSize | 滑动条大小 |
thumbSize | 滑块大小 |
bottomMagin | 滑动条距底部间距 |
progress | 设定初始值或获取滑动变化后的值 |
progressColor | 进度部分颜色 |
trackColor | 未进度部分颜色 |
thumbColor | 滑块颜色 |
centerColor | 中心点颜色 |
progressImage | 进度部分图片 |
trackImage | 未进度部分图片 |
thumbImage | 滑块图片 |
centerImage | 中心点图片 |
cornerRadius | 进度条圆角 |
thumbCornerRadius | 滑块圆角 |
shouldShowProgressLabel | 是否显示进度 Label,默认 YES |
progressLabelSize | 进度 label 大小 |
progressLabelBottomMagin | 进度 label 与 thumb 间距 |
progressLabelBgImage | 进度 Label 背景图 |
progressLabelBgColor | 进度 Label 背景颜色 |
progressLabelFont | 进度 Label 字体 |
progressLabelTextColor | 进度 Label 字颜色 |