budiadiono / react-native-custom-picker

React native customizable picker component.
https://www.npmjs.com/package/react-native-custom-picker
43 stars 8 forks source link

is not a issue, but... #11

Open eljoar opened 5 years ago

eljoar commented 5 years ago

Greetings to all, I am grateful to use "react-native-custom-picker", I am new programming, I would like to ask you if it is possible to add any images before the text (getLabel) ?, For example, I used your code to enter the list of countries (country-picker), I would like to use the information I use for the list of countries by adding their respective flags which are in the same file of the country list (getLabel = {item => item.countryList}, because I don't know yet how to import that data I would appreciate some information

eljoar commented 5 years ago

ups ... I found the solution, I just added the image of the flags in this way

<Image style = {{width: 25, height: 15}} source = {{uri: Item.flag}} />

  and when it is already selected

<Image style = {{width: 25, height: 15}} source = {{uri: selectedItem.flag}} />

where flag is within the array of the list of countries countrys = [ { countryName: "", flag: "data: image / png; base64 ..... }, { ... another country } ... and others ]