React-native-picker-select: Customize font family

Created on 3 Aug 2019  路  4Comments  路  Source: lawnstarter/react-native-picker-select

Is your feature request related to a problem? Please describe.
I use a custom fond in my App and I want to customize also the picker

Describe the solution you'd like
Add fontFamily props in the component

Describe alternatives you've considered
-
Additional context
-

All 4 comments

this is possible. use the style prop.

Hi @lfkwtz for v6.4.0 i tried

const styles = StyleSheet.create({
  sourcePicker: {
    color: 'red',
    fontFamily: 'Montserrat-Regular',
    fontSize: 36,
    marginLeft: 5,
    marginRight: 0,
    paddingRight: 30,
  },
})

<RNPickerSelect
  placeholder={placeholder}
  onValueChange={(val) => setSource(val)}
  items={incomeSources}
  style={styles.sourcePicker}
  value={source}
  pickerProps={{ style: styles.sourcePicker }}
  textInputProps={{ style: styles.sourcePicker }}
/>

But was only able to change color of chosen value. FontFamily for chosen value & dropdown items did not change. Any advice for me here?

Hi @lfkwtz ,

Its not working with style props. Please suggest a solution.

Thanks

https://snack.expo.io/gi7t8Jv_o

seems like it only works on android if useNativeAndroidPickerStyle is set to false which is unfortunate since that breaks long word ellipse truncation

Was this page helpful?
0 / 5 - 0 ratings