一个滑块允许用户只需触摸任意位置,即可轻松调整值
TouchSlider
让用户通过简单的点击,毫不费力地调整数值的滑块。
说明
@State var value: Double = 0
...
TouchSlider(
direction: .horizontal,
value: $touchSlider_value,
speed: 1, // multiplier to track gesture translation.
foregroundColor: Color.red,
backgroundColor: Color(white: 0.5, opacity: 0.3),
cornerRadius: 16
)
.frame(height: 80)