获取操作栏中的菜单项的看法

编程入门 行业动态 更新时间:2024-10-28 16:23:02
本文介绍了获取操作栏中的菜单项的看法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个 PopupWindow 我要锚定到一个操作栏的菜单项,但似乎无法反正拿到的查看。 这是必需的 PopupWindow showAsDropDown()方法。

I have a PopupWindow that I want to anchor to an action bar menu item but can't seem anyway to get at the View of the item that I want to click on. This is required for the PopupWindow showAsDropDown() method.

有谁知道如何实现这一目标?

Does anyone know how to achieve this?

推荐答案

您可以使用菜单项的ID,通过获取它 onOptionsItemSelected ..

You can get the view using the menu item id, by getting it in onOptionsItemSelected ..

findViewById(R.id.menu_item);

更多推荐

获取操作栏中的菜单项的看法

本文发布于:2023-11-16 19:31:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1607163.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:栏中   菜单项   看法   操作

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!