我试图DatePicker在另一个活动的顶部显示一个对话框,正在发生的是它以某种方式继承了它的颜色。
我希望它具有绿色的标头和白色的背景,

这是样式的节选
<style name="DatePickerDialog" parent="@android:style/Theme.Holo.Light">
<item name="android:windowFrame">@null</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="colorAccent">@color/primary</item>
</style>
Run Code Online (Sandbox Code Playgroud)
这段代码用来弹出 DatePicker
DatePickerDialog datepicker = new DatePickerDialog(this, R.style.DatePickerDialog, new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
TextView newdate = (TextView) findViewById(R.id.newdate);
Date date = getDate(year, monthOfYear, dayOfMonth);
DateFormat dateformat = new SimpleDateFormat(getResources().getString(R.string.date_format_full));
newdate.setText(dateformat.format(date));
}
}, newCalendar.get(Calendar.YEAR), newCalendar.get(Calendar.MONTH), newCalendar.get(Calendar.DAY_OF_MONTH));
datepicker.show();
Run Code Online (Sandbox Code Playgroud)

如果我在样式中指定白色背景, 
<item name="android:background">@color/app_background</item>
Run Code Online (Sandbox Code Playgroud)
我尝试过的最后一件事是AlertDialog.THEME_DEVICE_DEFAULT_DARK用作DatePicker主题
DatePickerDialog datepicker = new DatePickerDialog(this,
AlertDialog.THEME_DEVICE_DEFAULT_DARK, new
DatePickerDialog.OnDateSetListener()
Run Code Online (Sandbox Code Playgroud)

这是我从中打开对话框的活动的样式
<style …Run Code Online (Sandbox Code Playgroud)