alantoa / react-native-awesome-slider

🚀 An anwesome <Slider/> that supports various features haptic, lottie, animation, ballon, etc.
MIT License
278 stars 30 forks source link

Custom step layout issue #79

Open Resource-4 opened 2 months ago

Resource-4 commented 2 months ago

Expected OUTPUT :-

image

Current OUTPUT :-

image

How to apply padding/margin before starting the step and ending the step after that sync position of the Thumb in the center?

      <Slider
          style={{ marginHorizontal: 10, borderRadius: 30 }}
          progress={progress}
          minimumValue={min}
          maximumValue={max}
          step={10}
          renderMark={() => {
            return (
              <View
                style={{
                  height: 15,
                  borderRadius: 30,
                  backgroundColor: Color.GRAYSCALE,
                  borderWidth: 2,
                  borderColor: Color.GRAYSCALE,
                }}
              />
            );
          }}
          theme={{
            maximumTrackTintColor: Color.GRAYSCALE,
            minimumTrackTintColor: Color.GRAYSCALE,
            cacheTrackTintColor: Color.GRAYSCALE,
          }}
          thumbWidth={30}
          renderThumb={() => {
            return (
              <View
                style={{
                  width: 24,
                  height: 24,
                  borderRadius: 12,
                  backgroundColor: Color.VERMILION,
                }}
              />
            );
          }}
          renderBubble={() => {
            return <></>;
          }}
          snapToStep={true}
        />
dule-vikki commented 1 day ago

Same issue.

@alantoa This issue makes the UI is very bad. Help me fix it soon.