react-native-slider icon indicating copy to clipboard operation
react-native-slider copied to clipboard

Android not able to set Thumb height to more than 40

Open tasharofi opened this issue 8 years ago • 2 comments

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?

screen shot 2017-01-18 at 12 06 33 pm

<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,
  }
});

tasharofi avatar Jan 18 '17 01:01 tasharofi

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.

tasharofi avatar Feb 27 '17 00:02 tasharofi

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})} />

dmarkowski avatar Mar 27 '18 09:03 dmarkowski