picker icon indicating copy to clipboard operation
picker copied to clipboard

How to have small width picker on Android?

Open emclab opened this issue 4 years ago • 4 comments

Here is the picker code on React Native (0.64) Android:

           <Picker
                selectedValue={shippingMethod}
                mode={"dropdown"}
                style={{height: 40, width: 120}}. //<<==width 120 is still too big. How to make a smaller width picker?
                onValueChange={(itemValue, itemIndex) => {
                    setShippingMethod(itemValue)
                }}>
                <Picker.Item label="陆运" value="3" />
                <Picker.Item label="快递" value="2" />
                <Picker.Item label="特快" value="1" />
            </Picker>

Here is the how the picker looks like:

Screen Shot 2021-09-02 at 1 12 02 PM

The picker selection and the arrow-down is taking about half of the screen. How to make a smaller width picker? The current problem is that if width is too small, such as 80, then the selection result disappears and not visible.

emclab avatar Sep 02 '21 20:09 emclab

Hello guys, I have exactly the same question, the funny thing is previous version from "react-native" works with such task easily. I cannot realize why this version is going to replace the previous one, if this version cannot accomplish functionality previous one.

NicolayS avatar Sep 26 '21 14:09 NicolayS

No response? When trying to make them smaller, It will replace the content with dots, even though there is plenty of space left?

Cmoen11 avatar Jan 21 '22 07:01 Cmoen11

I have the same issue! Is there any update?

KevinvdBurg avatar Feb 02 '22 10:02 KevinvdBurg

This seems like a big issue as it does not work on android without giving it a width. Also the width requirement is not part of the documentation. Hence this is a bug. Is there any update?

elimau avatar Jan 09 '23 07:01 elimau