
@OverrIDe public voID onStart() { super.onStart(); //super.onStart() is where dialog.show() is actually called on the underlying dialog,so we have to do it after this point Dialog d = getDialog(); if (d != null) { int wIDth = VIEwGroup.LayoutParams.MATCH_PARENT; int height = VIEwGroup.LayoutParams.MATCH_PARENT; d.getwindow().setLayout(wIDth,height); d.getwindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); } } @OverrIDe public Dialog onCreateDialog(Bundle savedInstanceState) { final Dialog dialog = new Dialog(getActivity(),R.style.full_screen_dialog); return dialog;}解决方法 我刚刚发布了这个问题的解决方案 here 将以下主题添加到res / value-v21 / style
<style name="Dialogtheme" parent="@style/Base.theme.AppCompat.light.Dialog"> <item name="androID:windowTranslucentStatus">true</item></style>
然后在onCreate中的DialogFragment上应用Style
@OverrIDepublic voID onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setStyle(DialogFragment.STYLE_NO_Title,R.style.Dialogtheme);} 总结 以上是内存溢出为你收集整理的状态栏在全屏对话框片段android中将其颜色更改为黑色全部内容,希望文章能够帮你解决状态栏在全屏对话框片段android中将其颜色更改为黑色所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)