Why will React Native Picker not display on iOS?

naturallyfoster picture naturallyfoster · Jul 22, 2017 · Viewed 8.9k times · Source

I am trying to use the element in React Native. It works fine on Android but is not displaying on iOS.

<Picker selectedValue={'java'} >
  <Picker.Item label="Java" value="java" />
  <Picker.Item label="JavaScript" value="js" />
</Picker>

Answer

Poptocrack picture Poptocrack · Jul 24, 2017

You need to set a height and a width to your picker element

<Picker selectedValue={'java'} style={{height: 100, width: 100}}>
  <Picker.Item label="Java" value="java" />
  <Picker.Item label="JavaScript" value="js" />
</Picker>

Btw, the picker wont appear like the keyboard could.