【发布时间】:2015-10-02 16:12:42
【问题描述】:
我的 react-native 应用程序中有一个滑块组件,它使用 minimum/maximumValue 属性和 onValueChange 中的一些舍入很好地限制为 1-5 的离散值:
<View>
<Text style={styles.text} >
{this.state.value}
</Text>
<SliderIOS
ref='slider'
style={styles.slider}
value={1}
minimumValue={1}
maximumValue={5}
onValueChange={(value) => {
this.setState({
value: Math.round(value)
});
}}
/>
</View>
我希望滑块手柄按钮捕捉到离散位置 1、2、3、4、5,而不是沿着滑块连续移动。提示赞赏!
【问题讨论】:
标签: ios react-native