Android - PopupWindow above a specific view

前端 未结 8 519
孤城傲影
孤城傲影 2020-12-30 23:50

I am developing an application for Android and I am using a popup window when the user clicks a specific menu bar object(consisting of small images lined up horizontally) on

8条回答
  •  无人及你
    2020-12-30 23:59

    I have this code: PopupWindow below a specific view (Gravity End) for all sdk version.

            // display the popup[![enter image description here][1]][1]
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                mPopupWindow.showAsDropDown(v, 0, 0, Gravity.END);
            } else {
                mPopupWindow.showAsDropDown(v, v.getWidth() - mPopupWindow.getWidth(), 0);
            }
    

    Here View v is ImageButton Calendar.

提交回复
热议问题