如何显示如下图所示的弹出对话框?

时间:2015-03-23 17:37:09

标签: android

我想制作一个像流量赛车游戏分享按钮的弹出按钮。 此按钮显示三个项目,如此图片所示。 http://i.stack.imgur.com/6VrIz.png。 实际上这个按钮是这样的。 http://i.stack.imgur.com/wFnmg.png但按下它后,您会看到上图中显示的内容。 如果有人知道这个答案,请帮助我。 我搜索了很多,但我找不到任何东西。

2 个答案:

答案 0 :(得分:0)

使用以下库,您将获得所需内容,如图像https://github.com/futuresimple/android-floating-action-button/raw/master/screenshots/menu.gif

所示

<强>库

Android FLoating Action Button - &gt;检查示例应用程序

https://github.com/futuresimple/android-floating-action-button

答案 1 :(得分:0)

您还可以使用PopupWindow创建自定义下拉弹出窗口:

PopupWindow popupWindow = new PopupWindow(customLayout, width, height, true);// Create a custom layout with icons
popupWindow.setBackgroundDrawable(new ColorDrawable());
popupWindow.setOutsideTouchable(true);
popupWindow.setFocusable(true);
popupWindow.showAsDropDown(buttonMenu);// Define on your UI a button which will trigger your custom popup