简体   繁体   English

Android:如何更改DatePickerDialog标题栏的背景

[英]Android: How to change background of Title Bar of DatePickerDialog

I managed to apply a custom theme to the DatePickerDialog but there's still a Blue part in the header of the DatePickerDialog 我设法将自定义主题应用于DatePickerDialog,但DatePickerDialog的标题中仍然有一个蓝色部分

how can I change it ? 我该如何更改?

Please find the screenshot and my code below . 请在下面找到屏幕截图和我的代码。 .

This is the theme: 这是主题:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <style name="DiglrTheme" parent="android:Theme">        
            <item name="android:background">#3f863c</item>
        </style>
    </resources>

And this is where I applied it in the Activity : 这就是我在Activity中应用它的地方:

 @Override
    protected Dialog onCreateDialog(int id) {

        switch (id) {
        case DATE_DIALOG_ID:            
            return  new DatePickerDialog(this, R.style.DiglrTheme ,mDateSetListener, mYear, mMonth, mDay);                
        }
        return null;
    }

设置DatePickerDialog的样式

尝试:

android:background = "@android:color/transparent"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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