触摸Icon时如何显示弹出菜单

时间:2018-04-10 15:49:39

标签: react-native

https://cmichel.io/how-to-create-a-more-popup-menu-in-react-native/ 我如何从这个例子中调用popupmenu

1 个答案:

答案 0 :(得分:1)

假设您的模块中有UIManagerModule.showPopupMenu, 然后你可以通过UIManager class

调用这个类
import { UIManager, findNodeHandle } from 'react-native'

UIManager.showPopupMenu(
    findNodeHandle(this.state.icon),
    this.props.actions,
    this.onError,
    this.props.onPress
  )

通过查找显示herereference node的{​​{1}}来打开它。

它仅适用于 android ,可以遵循here