React Native ios picker is always open

后端 未结 8 701
天涯浪人
天涯浪人 2020-12-30 18:45

I have two pickers on my screen. Whenever I navigate to the screen in iOS app I find that the pickers are always open and all options are visible.

It works

8条回答
  •  情话喂你
    2020-12-30 19:33

    Use ActionSheet instead of Picker on iOS. https://facebook.github.io/react-native/docs/actionsheetios.html

    As answered by jevakallio this is the default behaviour on iOS. But this doesn't give a good UX so remove all picker components and replace with ActionSheet.

    I did and it works great. The reason I prefered ActionSheet over other components suggested by jevakallio because it is developed by the RN team and has a good native feeling. The last option suggested react-native-modal-picker is also very good.

提交回复
热议问题