picker
picker copied to clipboard
Bug: Make height and width required in the style prop
The picker doesn't work at all if we don't specify width and height, and there is no mention in the docs that we need to put it to make it work.
If we can have a default or height width or at least require it then it would be great for new devs cause I had to waste lot of minutes figuring it out.
It is really right ,I spent much time to find this reason, Thanks.
Chiming in to agree with this
Thats how i solve my problem.
<Picker
placeholder={placeholder}
selectedValue={value}
onValueChange={setValue}
mode='dropdown'
style={{
borderRadius: 5,
fontSize: 12,
transform: [
{ translateY: Platform.OS === "ios"? -8: -8 }, // Adjust this value to align the arrow and label
// { translateX: -5 }, // Adjust this value to align the arrow and label
{scaleY: .9},
// {scaleX: 1},
]
}}
itemStyle ={{
fontSize: 12,
}}
{...dropdownProps}
>
<Picker.Item label={placeholder} value={""} />
</Picker>
Also refresh the application once you change in transform property.