react-native-slider
react-native-slider copied to clipboard
ThumbImage work in Android but not in iOS
Environment
Binaries: Node: 14.17.6 - C:\Program Files\nodejs\node.EXE Yarn: Not Found npm: 8.3.0 - ~\AppData\Roaming\npm\npm.CMD Watchman: Not Found
Description
The slider's ThumbImage works fine in Android, but no show in iOS.
BTW, thumbTouchSize does not work both in Android and iOS.
Reproducible Demo
<Slider style={{ width:'100%', height:150, backgroundColor:"transparent", justifyContent: "flex-start", }} thumbImage={require('../icon/bright1.png')} thumbTintColor={'black'} minimumValue={0} maximumValue={1} thumbTouchSize={{width: 200, height: 200}} value={0.65} onValueChange={(value) => setLight(value)} minimumTrackTintColor={'white'} maximumTrackTintColor={'white'} />
Thumb partially works on iOS it seems. It gets set, but as soon as you start moving it, it disappears and appears once you stop.
Any ideas?
Any update on this issue?
I ended up using this https://github.com/Sharcoux/slider. Thumbnail works both in iOS and Android, can transform 90 degree into vertical. Hope it helps!
@rachellauyui From what I see on your example you are using an image for a thumb, but at the same time you set the thumbTintColor which overrides the image of your thumb.
Please keep in mind that setting both these props will not only conflict with each other, but at the same time is in fact pointless - If you have the image as a thumb you don't need to override it with the color of the default thumb.
I tested it using the thumbImage prop set as the only one and it works totally fine on all platforms - can you please try removing the thumbTintColor from your Slider usage and keep the thumbImage?
As an additional note: I'm sure it should be better documented, so I'll make an update to the docs about this for the next release.