We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to give a different background for every list item. I'm trying the following,
const data = [ { label: 'Item 1', value: '1' , itemContainerStyle: { backgroundColor: '#f6ede4'}, itemTextStyle: {color: '#fff'}}, { label: 'Item 2', value: '2' , itemContainerStyle: { backgroundColor: '#a07e56'}, itemTextStyle: {color: '#fff'}}, { label: 'Item 3', value: '3' , itemContainerStyle: { backgroundColor: '#3a312a'}, itemTextStyle: {color: '#fff'}}, ];
<Dropdown data={data} labelField="label" valueField="value" ... />
Please let me know if I'm doing something wrong. Thank you.
The text was updated successfully, but these errors were encountered:
const data = [ { label: 'Item 1', value: '1' , backgroundColor: '#f6ede4', color: '#fff'}, { label: 'Item 2', value: '2' , backgroundColor: '#a07e56', color: '#fff'}, { label: 'Item 3', value: '3' , backgroundColor: '#3a312a', color: '#fff'}, ];
return (<Dropdown data={data} labelField="label" valueField="value" renderItem={(item) => { return (
<Text style={{ flex: 1, fontSize: 16, backgroundColor : item.backgroundColor, color : item.color }}>{item.label}</Text> </View> ); }}
... />)
Sorry, something went wrong.
No branches or pull requests
I want to give a different background for every list item. I'm trying the following,
Please let me know if I'm doing something wrong. Thank you.
The text was updated successfully, but these errors were encountered: