数组将是这样 [{ id: 1, name: 'coton'}] 如何将标签和值设置为名称,这是我的代码
<DropDownPicker
uniqueKey="id"
displayKey = 'name'
items={AllMaterial}
containerStyle={{ height: 30, marginTop: 7 }}
style={{ backgroundColor: 'rgba(237, 237, 237, 1)' }}
labelStyle={{
fontSize: 9.17,
fontWeight: '700',
lineHeight: 12.19,
textAlign: 'left',
color: 'rgba(0, 0, 0, 1)',
}}
arrowStyle={{ margin: -8 }}
dropDownStyle={{ backgroundColor: 'white' }}
onChangeItem={item => setChoosenMaterial(item)}
/>