mostafa hashim
mostafa hashim

Reputation: 382

how to make custom popup window in listview item android

as question said , i made popup window on longclick on item listview , I tried this code

    private void Show_Comment_Options(View view) {
    // TODO Auto-generated method stub
    View popupView = activity.getLayoutInflater().inflate(R.layout.popupdialog_comment_option, null);

    final PopupWindow popup = new PopupWindow(popupView, WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT, true);
    popup.setBackgroundDrawable(new BitmapDrawable());
    popup.setOutsideTouchable(true);
    popup.showAsDropDown(view);
    int[] location = new int[2];
    popupView.getLocationOnScreen(location);
    popup.update();
}

but the popup window show perfectly with items that in top screen but with low item it hide some buttons from window like this picture enter image description here

how make it like facebook made and how make anchor o arrow like facebook make on item enter image description here

Upvotes: 1

Views: 3376

Answers (1)

Access Denied
Access Denied

Reputation: 9461

Try to specify height for your popup. Seem like it's a known problem with it: PopupWindow out of screen when size is unspecified

Upvotes: 2

Related Questions