react-native-toggle-element icon indicating copy to clipboard operation
react-native-toggle-element copied to clipboard

How do i padding for trackbar

Open hungdev opened this issue 2 years ago • 2 comments

Thank you for your lib @mymai91 I would like to make toggle like this: image

I tried with padding: 3px in trackBarStyle and trackBar, but it's not working. Please tell me how to do it. Here is my code:

      <Toggle
        value={value}
        onPress={onChange}
        trackBar={{
          width: 40,
        }}
        trackBarStyle={{ height: 24, width: 40, backgroundColor: Colors.PrimaryBlueBlizzardBlue }}
        thumbButton={{ height: 18, width: 18, radius: 9 }}
        thumbStyle={{ backgroundColor: Colors.white }}
      />

Thank you so much <3

hungdev avatar Dec 13 '22 10:12 hungdev

@hungdev Hey, not sure if you still have this issue but I ran into wanting to do this as well. I ended up just adding a wrapper container around the toggle and adding the padding on it and matching the background color of the wrapper and the trackBar.

May not work in your case but was the easiest solution for me.

Shannor avatar Mar 06 '23 23:03 Shannor