按钮上的自定义菜单单击下拉 [英] Custom Menu on button click as drop down

查看:29
本文介绍了按钮上的自定义菜单单击下拉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试实现 flipkart 应用程序的操作栏功能..

I am trying to implement the action bar functionality of the flipkart app..

为此,我已成功创建了一个自定义操作栏,但在将菜单显示为溢出图标下拉菜单时遇到了问题.

For this I have successfully created a custom Action Bar but I am facing problems in showing the menu as drop down on overflow icon click.

如果我尝试 Android Option Menu on button click 然后我得到没有图标的菜单 (4.2.2)在我屏幕的底部中央.使用自定义对话框或警报对话框会淡化背景,它们也会出现在屏幕中央.

If I try Android Option Menu on button click then on I am getting the menu without icons (4.2.2) at the bottom center of my screen. Using a custom dialog or alert dialog fades the background and they also appear on the center of the screen.

我应该怎么做才能获得与上图类似的功能?

What should I do to get the functionality similar as shown in the image above?

推荐答案

试试这个方法,希望能帮助你解决问题.

请按照链接说明显示带有图像的弹出菜单项,您可以使用 showAtLocation() 在所需位置显示弹出菜单.

Please follow link instruction to shown popup menu item with image and you can use showAtLocation() to shown popup as desired location.

检查: 带图标的弹出菜单

这篇关于按钮上的自定义菜单单击下拉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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