触摸图标时如何显示弹出菜单 [英] how to show popup menu when touching in Icon

查看:30
本文介绍了触摸图标时如何显示弹出菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

https://cmichel.io/how-to-create-a-more-popup-menu-in-react-native/ how I need to call popupmenu from this example

推荐答案

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

Assuming that you have UIManagerModule.showPopupMenu in your modules, then you can call this class via UIManager class

import { UIManager, findNodeHandle } from 'react-native'

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

通过找到iconreference node打开,如图此处.

It is opened by finding the reference node of the icon as shown here.

它仅适用于 android,但可以遵循 这里

It works only on android though, and can be followed here

这篇关于触摸图标时如何显示弹出菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆