React-native-slider: Remove space before and after the slider bar

Created on 20 Aug 2019  路  5Comments  路  Source: callstack/react-native-slider

When a new Slideer is created, it is created inside a view and I can see an space before and after the slider (just set backgroundColor='red' on the style)

This is quite annoying in order to make it if with other components as the slider is always a bit smaller

Is this done in purpose? Can those spaces (padding or margin) be removed and make the bar use 100%

I tried setting the padding, margin, left, right to 0, but nothing...

good first issue

Most helpful comment

You could temporarily put it inside a view with negative margins:

<View style={{ marginLeft: -10, marginRight: -10 }}>
  <Slider />
</View>

All 5 comments

You could temporarily put it inside a view with negative margins:

<View style={{ marginLeft: -10, marginRight: -10 }}>
  <Slider />
</View>

This behavior affects both platforms?

Is this issue still alive? I'd like to work on this issue but the example app doesn't reproduce this.

Or with marginHorizontal: -10

I see this issue only on Android. I applied the following style to the slider:

marginLeft: Platform.select({ ios: 0, android: -15 }),
marginRight: Platform.select({ ios: 0, android: -15 })

Kinda annoying but it works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bahmanian picture bahmanian  路  7Comments

HasanAlyazidi picture HasanAlyazidi  路  3Comments

lolcookie picture lolcookie  路  7Comments

cinder92 picture cinder92  路  4Comments

chrisfromwork picture chrisfromwork  路  3Comments