PopupWindow being cutoff towards bottom of screen

dialog boxes not displaying properly
dialog box not showing up screen
print dialog box not appearing in chrome
dialog boxes not displaying properly windows 10
chrome dialog box not showing
windows 10 dialog box not appearing
windows 10 popup not showing
make it easier to read what on your screen windows 7 registry

PopupWindow inflates fine until it is near bottom of screen it's being cut off. Anyone know how I can it inflate upwards when it's towards bottom of screen?

public SelectBucketMenu(Context context) {
        super(context);
        this.mContext = context;

        setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        setOutsideTouchable(true);
        setFocusable(true);
        //Need set windowlayout for API 19 otherwise window won't appear
        setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);

        setupView();
    }

    private void setupView(){
        View view = LayoutInflater.from(mContext)
                .inflate(R.layout.popupmenu_selectbucket, null);
        ButterKnife.bind(this, view);
        setContentView(view);
    }

Anyone know why?

Measuring the view and then setting the height fixed my issue.

View view = LayoutInflater.from(mContext).inflate(R.layout.popupmenu_addphotos, null);
view.measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
setHeight(view.getMeasuredHeight());

Action selection popup getting cut-off at screen bottom, nope, the popup disappears when you try to scroll and the scrollbar disappears then (since the page is now smaller without that popup). 3 PopupWindow being cutoff towards bottom of screen Jan 22 3 RecyclerView scrolling to bottom of page doesn't trigger .addOnScrollListener's canScrollVertically Feb 21 View all questions and answers →

I replaced the folowing line

setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);

with

setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT, 0);

and set the Popup height by calling setHeight method.

The final code is as below:

public SelectBucketMenu(Context context) {
    super(context);
    this.mContext = context;

    setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    setOutsideTouchable(true);
    setFocusable(true);
    //Need set windowlayout for API 19 otherwise window won't appear
    setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT, 0);
    setHeight((int)mContext.getResources().getDimension(R.dimen.bucket_menu_height));
    setupView();
}

Update If you need to calculate popup height at runtime, you can find the idea in this answer. Then the final code could be like below:

public SelectBucketMenu(Context context) {
    super(context);
    this.mContext = context;

    setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    setOutsideTouchable(true);
    setFocusable(true);
    //Need set windowlayout for API 19 otherwise window won't appear
    setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT, 0);

    setupView();
}

private void setupView(){
    View view = LayoutInflater.from(mContext)
                .inflate(R.layout.popupmenu_selectbucket, null);
    ButterKnife.bind(this, view);
    setContentView(view);

    int spec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec. UNSPECIFIED);
    view.measure(spec, spec);
    setHeight(view.getMeasuredHeight());
}

Update 2 The following code is useless, you can remove it.

setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT, 0);

Problem with part of program window being cut off, For some reason, the right side of the program is cut off and I can't I'm wondering if that is what is causing the program to display improperly. Once i connected the monitor to the HDMI cable the monitor refreshed just to cut off portions on all four sides , i.e., the complete screen is not being used. Around 2cms on the horizontal axis & 1cm on the vertical axis is spared. My screen resolution is: 1920x1080 Framerate: 60Hz.

PopupWindow class actually manages the inflation for you.

Just initialise it like this :

popupWindow.showAsDropDown(view, offsetX, offsetY, gravity);

here, view is the anchor over or under which you want to show the popup.

Custom view height is cut on Android 24 � Issue #40 � douglasjunior , The height of a custom view is cut, when the anchor point is on the very top or very bottom of the screen. GitHub is home to over 50 million developers working together to host and review code, manage projects, On Android 24, apparently, PopupWindow changed behavior when it did not fit the screen. Thank you for asking, Michael. In my experience, the most common reason this continues to happen is due to the driver for the video card being out of date or incorrect.

Dialog / Popup boxes not displaying content fully?, Now the bottom of the dialog box is "cut-off" and I cannot access When I go to system display settings and reduce "scale and layout" from the� The printer driver may incorrectly substitute screen fonts at certain view percentages. If you change the printer driver, you may notice an immediate difference, depending on the view you are using. Case 3 The zoom percentage that the document is set to may cause characters to have the top or bottom portion of the screen font cut off.

Part of a pop-up window appears off-screen in Internet Explorer 8, On a computer that is running Windows 7 or Windows Server 2008 However, you expect the pop-up window to appear completely on-screen. I think one of my kids pressed a monitor button or something - when I came home the image on my screen has shifted to the left so that now the left side is cut off and there is an empty space on

Edit Address Popup window can't scroll to confirm, I'm trying to edit a shipping address in CHROME browser screen resolution the buttons at the bottom are cut off and I can't confirm the changes to the There have been several posts about this the past few weeks - I don't� Hi, I agree with Rick Dee, in addition, as far as I know, you probably fixing the issue by resizing the screen through the graphics cards firmware which actually makes a custom resolution on the screen so that you can view the entire image, but there is a setting on most newer TV's called over scan which basically cuts the edges of the screen off for broadcast television but with a digital

Comments
  • Does it work on API 19? I tested it but it didn't work. I mean popup didn't appear.
  • yeah it works on my api 19 real device. Did you place it before setContentView(view);?
  • I did it before setContentView(view); but it still doesn't work. I tested on Emulator. Could you please share your code completely?
  • I found the problem. I don't know why view.measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); doesn't work for me even on API 29 but int spec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec. UNSPECIFIED); view.measure(spec, spec); works well.
  • Tried it, still being clipped towards bottom of screen i.imgur.com/iYH2ddO.png
  • Is nav_header_height the height of your popup window?
  • Whats the way to get the height of view instead of using a defined dimension height? View view = LayoutInflater.from(mContext) .inflate(R.layout.popupmenu_addphotos, null);
  • the way I used below doesn't need this extra line to also work on API 19. setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT, 0); but I'll give you the bounty