简体   繁体   中英

Absolute Positioning of Dialog Fragment

I am trying to position myCustom Dialog using the below piece of code.. but somehow for the edge points the dialog is not cropping from the edges cases..I am basically trying to show dialog over a menu Item icon..

    Window window = getDialog().getWindow();
    WindowManager.LayoutParams params = window.getAttributes();
    window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    params.x = (int) x;
    params.y = (int) y;
    window.setAttributes(params);

在此处输入图片说明

The glowing circle is a dialog box ,I want to shift to over the Menu Item How do I implement corner cases??

What you want in that case is a full screen dialog, you have to add the following flags when creating the dialog:

window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                        WindowManager.LayoutParams.FLAG_FULLSCREEN);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM