【发布时间】:2014-04-16 19:14:08
【问题描述】:
我所有的主题都在我的对话片段背景旁边工作。 我试图让我的 dialogFragment 背景变黑,但我做错了。
到目前为止,我在主题 xml 中得到了什么(请注意,我将它的顶部和底部进行了中继):
<style name="easydealtheme" parent="@style/_easydealtheme"/>
<style name="_easydealtheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:editTextBackground">@drawable/easydealtheme_edit_text_holo_light</item>
<item name="android:dropDownListViewStyle">@style/Listviewdropdowneasydealtheme</item>
<item name="android:textViewStyle">@style/Textvieweasydealtheme</item>
<item name="android:editTextStyle">@style/Edittexteasydealtheme</item>
<item name="android:alertDialogTheme">@style/Dialogeasydealtheme</item>
...
这是我在对话框的样式 xml 中得到的内容:
<style name="Dialogeasydealtheme" parent="android:Theme.Holo.Dialog">
<item name="android:textColor">#FFFFFF</item>
<item name="android:windowBackground">@color/test</item>
</style>
这是显示 dialogFragment 的代码:
public static void ShowPhotoDialog(String title,File photoFile, FragmentManager fragM)
{
FragmentPhotoDialog photoD = new FragmentPhotoDialog();
FragmentTransaction fTX = fragM.BeginTransaction();
photoD.SetStyle(DialogFragmentStyle.NoFrame, EasyDeal_Android.Resource.Style.easydealtheme);
photoD.SetTile(title);
photoD.SetPhotoFile(photoFile);
photoD.Show(fTX, "Dialog");
}
这里的结果不起作用(白色应该是黑色):
【问题讨论】:
-
对话框文本颜色是否有效?
-
自定义主题的父基主题是什么
-
自定义主题父是:parent="android:Theme.Holo.Light.DarkActionBar"
标签: android android-layout android-fragments android-theme