How can I give fontSize to picker (android)? I tried to give but it's not working
<Picker
style={{fontSize:20}}
selectedValue={this.state.language}
onValueChange={(lang) => this.setState({language: lang})}>
<Picker.Item label="Java" value="java" />
<Picker.Item label="JavaScript" value="js" />
</Picker>
To anyone still searching, Here's what I found:-
Enter the 'fontSize' style property individually to every picker.item.
<Picker.Item style={{fontSize:12}} label={'AnyValueLabel'} value={'AnyValueName'}/>
This does the trick perfectly well. Just change the scale value.
const styles = StyleSheet.create ({
selectInput: {
transform: [
{ scaleX: 0.9 },
{ scaleY: 0.9 },
],
},
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With