简体   繁体   中英

how can I can change background color of dropdown in React-native-picker and not able to change that(currently showing grey). So how can I?

I am not able to change the background colour of dropdown in react-native-picker and its currently showing grey. I am using https://www.npmjs.com/package/@react-native-picker/picker

Did you try

style={{ backgroundColor: "red" }} // Or whatever color you like..

Like this

<Picker
  selectedValue={selectedLanguage}
  style={{ backgroundColor: "red" }}
  onValueChange={(itemValue, itemIndex) =>
    setSelectedLanguage(itemValue)
  }>
  <Picker.Item label="Java" value="java" />
  <Picker.Item label="JavaScript" value="js" />
</Picker>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM