react-native-dropdown-picker
react-native-dropdown-picker copied to clipboard
DropDownPicker style={{height: ?}} doesnt work
Hello,
I have - "react-native-dropdown-picker": "^5.1.19", There is that problem, by default main input container height is somethink about 40, i want to set it 35, couse i have other buttons, and i want them to same style... But it doesnt work. containerStyle is possible to change height. Tried to put paddings and margins for 0, doesnt help. Whats propblem there can be ?
@LyrranKelmalu Can you try setting minHeight for the dropdown styling to the number you want?
@parsa-j42 yea i tried, it doesnt help. There is some problem with parent container, becouse when i put dropdows outside of it, that works. =(
So i have
<View> <ScrollView> ...stuff inside.... <ScrollView> <DropDownPicker open={open} value={value} items={provinces} placeholder="Maakunnat..." containerStyle={open ? styles.dropDownContOpen : styles.dropDownContClose} style={styles.dropDownStyle} dropDownContainerStyle={styles.dropDownContainerStyle} placeholderStyle={{height: 35}} arrowIconStyle={styles.arrowIconStyle} onChangeValue={(value) => { filterArrByProvince(value); }} setOpen={setOpen} setValue={setValue} setItems={setProvinces} /> </View>
Here is the styles:
dropDownContClose: { borderRadius: 25, width: 150, height: 35, backgroundColor: '#FFF' }, dropDownContOpen: { borderRadius: 25, borderBottomStartRadius: 0, borderBottomEndRadius: 0, width: 150, height: 35, backgroundColor: '#FFF', }, arrowIconStyle: { width: 20, height: 20, marginBottom: 15 }, dropDownStyle: { borderRadius: 25, borderWidth: 0, backgroundColor: 'transparent', height: 22 }, dropDownContainerStyle: { borderWidth: 0, marginTop: -14, borderBottomStartRadius: 25, borderBottomEndRadius: 25 },
@parsa-j42 And i get that done, by assign transparency to dropdown container, but after it list buttonst doesnt work, so i cant chose value from list.
Changed for modal, it works fine and i can implement it in app.
Hi! i found this issue also, but i manage to found the containerProps and the the dinamic height there.
it works good.

minHeight worked for me
dropDownContainerStyle={{minHeight: 200}}
minHeight worked for me
dropDownContainerStyle={{minHeight: 200}}
That was awesome, worked!!!
@LyrranKelmalu Can you try setting
minHeightfor the dropdown styling to the number you want?
For me it worked