Show AlertDialog with ImageView without any padding

后端 未结 8 1409
灰色年华
灰色年华 2020-12-23 15:04

EDIT - SOLUTION:

I ended up figuring out a way to solve this issue. Because manually changing the height of the ImageView removes the extra padding,

8条回答
  •  庸人自扰
    2020-12-23 15:35

    Im not quite sure, but I think its the type of dialog you are showing that adds the padding. This type of dialog does not hide the entire activity. What I use to hide the entire activity is:

    /**
     * Show the overlay using the WindowManager class.
     * @param overlay The overlay that needs to be shown.
     */
    public void showOverlay(View overlay) {
        WindowManager.LayoutParams params = new WindowManager.LayoutParams(
                WindowManager.LayoutParams.MATCH_PARENT,
                WindowManager.LayoutParams.MATCH_PARENT,
                WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
                        WindowManager.LayoutParams.FLAG_FULLSCREEN,
                PixelFormat.TRANSLUCENT);
    
        getWindowManager().addView(overlay, params);
    }
    

    You could probably find an option that does what you need. However you will need to create a layout containing the buttons and image should you want to use the above method.

    Check the options out: http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html

提交回复
热议问题