Rotate is not working
I am trying to rotate the Slider vertically but transform function is not working. Same code is working with Native Slider. Here is how I am doing it -
<Slider style={sliderStyles(width, height).slider} minimumValue={-1} maximumValue={1} value={0} minimumTrackTintColor={'yellow'} transform={[{rotate: '-90deg'}]} />
Vertical slider created using transform does not work as expected
Link to the snack https://snack.expo.io/@yajana/slider
I tried this way. This worked for me:
import React, { useEffect, useState } from 'react'
import Slider from '@react-native-community/slider'
const VerticalSlider = () => {
const [style, setStyle] = useState({})
useEffect(()=> {
setStyle({transform: [{ rotate: '-90deg' }]})
}, [1])
return (
<Slider
minimumValue={0}
maximumValue={1}
minimumTrackTintColor="#FFFFFF"
maximumTrackTintColor="#000000"
style={[{ width: 300, height: 40 }, style]}
/>
)
}
export default VerticalSlider
@pankajgupta1 I tried your solution in the snack https://snack.expo.io/@yajana/slider I am not able to get it working. VerticalSliderSolution is the component.
@YajanaRao I tried this, But there is some error for android : View config not found for name RNCSlider
I think this is with expo. try to use this in real project on real device, May be there work. In my android code which is using in my project, this is working like a charm.
Here I saw in web too, in there I saw problem, there on vertically sliding that is not working, but when we horizontally slide this vertical slide working.
Give a try on real device, I think that will work. ON android , ios this is working good.
@YajanaRao Hey did u find any solution for it?? I need vertical slider with snap points but could not find it
@yesnoyes I've tested this on the latest release (v4.1.1) and this issue does not occur. Can you verify on your side using the latest release?
Closing due to lack of author's feedback.