Android 设置对话框全屏

1、在styles.xml中添加一个style:

  

 <style name="Dialog_Fullscreen">
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowNoTitle">true</item>
</style>

2、在代码中设置dialog的theme:

Dialog dialog=new Dialog(getApplicationContext(),R.style.Dialog_FullScreen);
dialog.setContentView(R.layout.call_phone_layout);
//这句话与本章无关,用于在没有window的context上 dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); dialog.show();

 

转载于:https://www.cnblogs.com/libertycode/p/5680771.html

    原文作者:weixin_30312563
    原文地址: https://blog.csdn.net/weixin_30312563/article/details/97872772
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞