I have created custom dropdown where I am getting all countries data, it's working fine but the layout is not correct. The first field of the form is country field, so the list should come under that.

What I have tried 1. Position relative and absolute 2. Margin and padding

Below is the code

<View style={{ marginTop: 15, position: 'relative' }}>
    <CustomPicker
        data={this.countryDs}
        source={require("../../resource/img/globe.png")}
        selectedValue={this.reg_country}
        onValueChange={this.onCountryChange.bind(this)}
        style={{ position: 'absolute',top:20 }}
     />
</View>

and below is the current output image

enter image description here

while I want

enter image description here

0 Answers