
PlusMinusSlider 可以表示负值。它是用 SwiftUI 编写的。
pod “PlusMinusSlider”
导入框架。
import PlusMinusSlider
创建 PlusMinusSlider 并必须填充 “thumbValue”。
import SwiftUI
struct ContentView: View {
@State var thumbValue: Double = 0
var body: some View {
PlusMinusSlider(thumbValue: $thumbValue)
}
}
如果需要,您可以通过一些修改来更改外观。
.isHideLimitValue(_ bool:)
.isHideThumbValue(_ bool:)
.isIntThumb(_ bool:)
.isSmoothDrag(_ bool:)
.limitValueOffset(_ offset:)
.maxValueColor(_ color:)
.maxValueFont(_ font:)
.maxValueFontWeight(_ weight:)
.minValueColor(_ color:)
.minValueFont(_ font:)
.minValueFontWeight(_ weight:)
.sliderColor(_ color:)
.thumbColor(_ color:)
.thumbValueColor(_ color:)
.thumbValueFont(_ font:)
.thumbValueFontWeight(_ weight:)
.valueColor(_ color:)
该库基本上未测试。请通过 GitHub 上的问题跟踪器报告错误。
Apache License 2.0 许可。有关更多信息,请参阅 LICENSE 文件。
谢谢!