picker
picker copied to clipboard
the problem of selectionColor
Hello, I want to change the color of my number when it is selected, but I can't change it using selectionColor. The following is my code:
eturn ( <View style={styles.container}> <Picker style={[styles.picker, {width: screenWidth / 4.5}]} selectedValue={selectedHour} onValueChange={itemValue => setSelectedHour(itemValue)} selectionColor={processColor('#e83b30')}> {[...Array(12)].map((_, index) => ( <Picker.Item label={
${index + 1}} value={
${index + 1}} key={index} selectionColor="#e83b3e" /> ))} </Picker>
In addition, I also want to change the color of the gray rectangular selection box in the middle. How should I change it?
same issue
This appears to be a regression -- you can get it working by falling back to 2.4.9
.
h/t @AdePhil https://github.com/react-native-picker/picker/issues/294#issuecomment-1871253377
Downgrading to v2.4.9
didn't resolve the issue either. If possible, could you provide sample code that works? Thank you!
Alternatively, are there any other solutions available?