react-native-material-dropdown
react-native-material-dropdown copied to clipboard
Label Alignment
how to align the label to the right and change the fontFamily ?
any luck??
Also looking to set label styles.
I'd like to change the font color & size of the label vs floating label color once a selection is picked.
Same here, would like to change the fontFamily.
i want to RTL how to do this?
Just pass your styles to inputContainerStyle={{your styles}}
You can control RTL or LTR using renderBase prop. Say you have a Row component that handles the direction
const styles = StyleSheet.create({
default: {
display: 'flex',
flexDirection: 'row', // Here you can control the direction
},
});
function Row(props) {
const style = Array.isArray(props.style) ? props.style : [props.style];
return (
<View {...props} style={[styles.default, ...style]}>
{props.children}
</View>
);
}
Then you can just use it as follows.
<Dropdown
...dropdownProps
renderBase={props => {
return (
<Row>
<Text>
{props.title}
</Text>
{props.renderAccessory() /* This part is the arrow */}
</Row>
);
}}
>