Android dialog Full Screen display

Source: Internet
Author: User

Most of the online introduction is implemented in Styles.xml add <item name="Android:windowfullscreen">true</ Item>
This property, but do not work in accordance with the operation, and then try to do their own, the summary method is as follows code

Dialog Dialog =NewDialog ( This, R.style.dialog);d ialog.show (); Layoutinflater Inflater= Layoutinflater.from ( This); View Viewdialog= Inflater.inflate (R.layout.adapter_list,NULL);D isplay Display= This. Getwindowmanager (). Getdefaultdisplay ();intwidth =display.getwidth ();intHeight =display.getheight ();//Setting the width of the dialog to the width of the screenViewgroup.layoutparams Layoutparams =Newviewgroup.layoutparams (width, height);d ialog.setcontentview (Viewdialog, layoutparams);

The main important step is to set the width of the dialog to the width of the screen, so that the dialog can be displayed in full screen.

Android dialog Full Screen display

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.