1

我无法更改 react-native-picker 中下拉菜单的背景颜色,并且它当前显示为灰色。我正在使用 https://www.npmjs.com/package/@react-native-picker/picker

4

1 回答 1

0

你试过了吗

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

像这样

<Picker
  selectedValue={selectedLanguage}
  style={{ backgroundColor: "red" }}
  onValueChange={(itemValue, itemIndex) =>
    setSelectedLanguage(itemValue)
  }>
  <Picker.Item label="Java" value="java" />
  <Picker.Item label="JavaScript" value="js" />
</Picker>
于 2021-05-04T10:45:50.567 回答