自定义上下文菜单,如pinterest菜单

Vik*_*tel 8 android android-gridview android-contextmenu

每当GridView按下项目时,我一直在寻找类似Pinterest菜单的东西.我知道这个问题太广泛了.但是,对问题的小罢工将提供实现这些目标的正确方法.

阙:

如何在GridView项目上实现自定义上下文菜单,如Contacts +或Pinterest Context菜单?

Pinterest上下文菜单 联系人+上下文菜单

尝试:

ArcMenu:但它们取代了Slider Menu或弹出菜单以用于整个应用程序.我想要可以为GridView项创建onFly的菜单.

卫星菜单:与ArcMenu相同,替换滑块菜单或弹出菜单以用于整个应用程序.

请赐教我实现这些行为.

Abh*_*k V 1

我认为Context Menu您可以根据PopupWindow您的要求使用。

 //Custom popup view
View view= layoutInflater.inflate(R.layout.popupview, null);  
PopupWindow popupWindow = new PopupWindow(
               view, 
               LayoutParams.WRAP_CONTENT,  
                     LayoutParams.WRAP_CONTENT);

//Display popup window on clicking anything
//Displays pop up window near button with offsets 10 and -10
popupWindow.showAsDropDown(button, 10, -10);
Run Code Online (Sandbox Code Playgroud)

欲了解更多信息

http://developer.android.com/reference/android/widget/PopupWindow.html

http://android-er.blogspot.in/2012/03/example-of-using-popupwindow.html