Appcompact DialogFragment单选复选标记颜色 [英] Appcompact DialogFragment single-choice checkmark color
本文介绍了Appcompact DialogFragment单选复选标记颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有问题.我的活动具有风格
I have a problem. My activity has style
<style name="MaterialTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/action_bar_background</item>
<item name="colorPrimaryDark">@color/action_bar_background</item>
<item name="colorAccent">@color/action_bar_background</item>
</style>
我也有带有简单的单选选择器的dialogFragment.
also i have dialogFragment with simple single-choice chooser.
@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
final AlertDialog.Builder dialog = new AlertDialog.Builder(getActivity());
dialog.setTitle(R.string.image_resolution);
dialog.setSingleChoiceItems(R.array.quality_labels, getPosition(), this);
return dialog.create();
}
如何更改选择器复选标记的颜色(绿色圆圈)???
How to change color of picker checkmarks (green circles) ???
推荐答案
您必须为 AlertDialog
<style name="MaterialThemeDialog" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="colorAccent">@color/action_bar_background</item>
</style>
并将其传递给 AlertDialog.Builder
构造函数
@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
final AlertDialog.Builder dialog = new AlertDialog.Builder(
getActivity(),
R.style.MaterialThemeDialog);
dialog.setTitle(R.string.image_resolution);
dialog.setSingleChoiceItems(R.array.quality_labels, getPosition(), this);
return dialog.create();
}
这篇关于Appcompact DialogFragment单选复选标记颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文