Customise context menu like pinterest menu

后端 未结 4 1421
说谎
说谎 2021-02-02 03:15

I\'ve been looking for something like Pinterest menu whenever item in GridView is pressed. I know it\'s too broad question. But little strike on question will provi

4条回答
  •  一个人的身影
    2021-02-02 03:28

    I think instead of Context Menu you can use PopupWindow for your requirement.

     //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);
    

    For more info

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

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

提交回复
热议问题