Javascript React-Native,更改React-Native社区/滑块和拇指图标的高度
我在我的应用程序中使用了Javascript React-Native,更改React-Native社区/滑块和拇指图标的高度,javascript,reactjs,react-native,Javascript,Reactjs,React Native,我在我的应用程序中使用了@react native community/slider,但我面临的问题是,它的高度没有变化,它的宽度在变化,但高度没有变化,有人知道为什么吗?我还想在滑块拇指内的蓝色容器中渲染滑块的值,有什么方法可以做到吗?请帮忙 这是我的滑块代码 <View> <Text style={[style.fontSize15Med, styles.font15]}> Number of surveys
@react native community/slider
,但我面临的问题是,它的高度没有变化,它的宽度在变化,但高度没有变化,有人知道为什么吗?我还想在滑块拇指内的蓝色容器中渲染滑块的值,有什么方法可以做到吗?请帮忙
这是我的滑块代码
<View>
<Text style={[style.fontSize15Med, styles.font15]}>
Number of surveys
</Text>
<View style={styles.daysCont}>
<Text style={[style.fontSize12Med, styles.surveys]}>
{this.state.surveys}
</Text>
</View>
<Slider
style={{width: 320, height: 30, marginLeft: 40}}
minimumValue={0}
maximumValue={10}
step={1}
maximumTrackTintColor={colors.DarkBlue}
minimumTrackTintColor={colors.primary}
thumbTintColor={colors.skyBlue}
value={this.state.surveys}
onValueChange={(val) => this.setState({surveys: val})}
/>
</View>
调查次数
{this.state.surveys}
this.setState({surveys:val})}
/>
您可以使用自定义拇指图像,如
const thumbImage = require('shared/img/slider-thumb.png');
<Slider
.......
thumbImage={thumbImage}
style={{width: 200, height: 40}} // height, width
/>
const thumbImage=require('shared/img/slider thumb.png');
此处找到更多信息我可以在图像上渲染文本吗?不,只需放置图标即可,所以我无法渲染文本,滑块的高度如何?无法在滑块视图内渲染文本。我已经更新了我的身高答案,请检查。