简体   繁体   中英

How to call a function when pressing the default react native picker in react native

I'm using react-native picker in dialog mode. Now I want to call a function whenever the dialog opens. How can I achieve that because there is no onPress prop? Any help will be appreciated. Please don't recommend any other packages because I want to use the default one.

不使用Picker也可以实现,使用TouchableOpacity来调用一个函数,在同一个函数中只需要打开一个Modal来显示Picker的项目列表,从列表中选择任何项目时关闭Modal。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM