react-native-resegmented-control
react-native-resegmented-control copied to clipboard
It would be nice to have sliderStyle props
(
react-native-resegmented-control
vs react-native-community/segmented-control
)
Slider backgroundColor
is hardcoded to white
, it's difficult to customize the theme in dark mode.
It would be nice to have sliderStyle
(or sliderBackgroundColor
) props to override it.
Published v2.3.0 which includes sliderStyle
.
Let me know if this works for you!
Thanks, it works!
But the last Segment
looks missing some padding:
Can you share a screenshot or the code to replicate?
Sorry, the screenshot I uploaded earlier is broken...
Code:
const styles = StyleSheet.create({
segmentedControl: {
width: 140,
backgroundColor: "rgba(255,255,255,.1)",
},
segmentedSlider: {
backgroundColor: "rgba(255,255,255,.25)",
},
})
// ...
<SegmentedControl
activeTintColor="#fff"
inactiveTintColor="#fff"
initialSelectedName="HEX"
style={styles.segmentedControl}
sliderStyle={styles.segmentedSlider}>
<Segment name="HEX" content="HEX" />
<Segment name="HSLuv" content="HSLuv" />
</SegmentedControl>
Ah, thanks for reporting this!
I'll take a look and see if some tweaking can fix this 😄