I am using react-native-material-dropdown for a form where I also use RN TextInput so I want a consistent look between both.
I want to have a black label header and a light grey underline
For Android I use underlineColorAndroid={'transparent'}
and that works fine.
The problem is on iOS if I change the baseColor property, it automatically changes the dropdown arrow, the underline and the label.
How could set the color of the label and the underline separately?
import { Dropdown } from 'react-native-material-dropdown'
//...
<Dropdown
underlineColorAndroid="transparent"
label={'BILLING TYPE'}
labelFontSize={12}
labelTextStyle={styles.dropdownLabel}
itemTextStyle={styles.dropdownItem}
style={styles.dropdownMainText}
style = {{color: Colors.black}}
baseColor={Colors.black}
value={'Paper'}
data={billingTypes}
onChangeText={value => this.onEditField(value)}
/>
If I set baseColor={Colors.black} (which I want) the underline becomes black instead of grey (which I don't want).
If I set baseColor={Colors.rose}, all 3 elements change colors: label, arrow and underline.
here is my styles.js file where nothing special happens
export default StyleSheet.create({
//...
dropdownLabel: {
textTransform: 'uppercase',
color: Colors.black,
},
dropdownItem: {
fontSize: Fonts.size.tiny,
color: Colors.black,
},
dropdownMainText: {
},
});
const colors = {
black: '#252525',
rose: '#e6968f',
};