react-native-slider
react-native-slider copied to clipboard
Android not able to set Thumb height to more than 40
Hi,
Ive noticed I am not able to set the thumb height to more than 40 on Android (see screenshot attached). Somehow there is a max height of 40 set somewhere. Any idea how to fix?
<Slider
trackStyle={customStyles7.track}
thumbStyle={customStyles7.thumb}
value={this.state.value}
onValueChange={(value) => this.setState({value})} />
var customStyles7 = StyleSheet.create({
track: {
height: 1,
backgroundColor: 'gray',
},
thumb: {
width: 58,
height: 58,
backgroundColor: 'rgba(255, 255, 255, 0.1)',
borderColor: 'rgba(255, 255, 255, 0.9)',
borderWidth: 4,
borderRadius: 30,
}
});
Anyone having the same problem, found the root cause: in Slider.js line 505, the height has been hard coded and can be modified based on your requirement.
Had the same problem and as @tasharofi wrote I modified it by adding style to slider component
<Slider style={{height: 80}} trackStyle={customStyles7.track} thumbStyle={customStyles7.thumb} value={this.state.value} onValueChange={(value) => this.setState({value})} />