在Android中创建新主题
大家好,我只是几天的经验,以安卓,学习。。 我正在尝试制作一款使用主题的应用程序,但遇到了一个问题,希望你能帮我解决 这是我的布局在Android中创建新主题,android,android-layout,Android,Android Layout,大家好,我只是几天的经验,以安卓,学习。。 我正在尝试制作一款使用主题的应用程序,但遇到了一个问题,希望你能帮我解决 这是我的布局 <CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" android:layout_width="match_parent" android:layout_height="wrap_content" a
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:checkMark="?android:attr/textCheckMark"
android:paddingStart="10dp"
android:paddingEnd="10dp"
style="?TextColor"
/>
现在的问题是背景图像的设置很好,这意味着主题正在工作。
但我认为TextColor并没有改变其始终为白色,无论是否应用主题
你知道我的代码出了什么问题吗
提前谢谢
这是截图
对不起,我忘了提到:
背景图像是为根RelativeLayout设置的,我要设置的textcolor是为选中TextBox的ListView设置的
您应该使用
<style name="image" parent="@android:style/Widget.ImageButton">
<item name="android:background">#000000 <!-use your selector for image buttons --></item>
</style>
#000000
背景图像按钮的样式文件和文本视图的以下代码
<style name="text" parent="@android:style/Widget.TextView" >
<item name="android:textColor"><!-use your textcolor --></item>
</style>
编辑
@样式/应用程序背景图片红色
@样式/应用程序\文本\颜色\黑色
@风格/形象
@样式/文本
试试这个
<!-- RED Theme -->
<style name="NoteItTheme.RED">
<item name="pageBackgroundImage">@style/App_Bg_img_red</item>
<item name="android:textViewStyle">@style/App_text_color_black</item>
</style>
<style name="App_text_color_black" parent="@android:style/Widget.TextView" >
<item name="android:textColor">@color/Black</item>
</style>
@样式/应用程序背景图片红色
@样式/应用程序\文本\颜色\黑色
@颜色/黑色
<style name="image" parent="@android:style/Widget.ImageButton">
<item name="android:background">#000000 <!-use your selector for image buttons --></item>
</style>
<style name="text" parent="@android:style/Widget.TextView" >
<item name="android:textColor"><!-use your textcolor --></item>
</style>
<style name="NoteItTheme.RED">
<item name="pageBackgroundImage">@style/App_Bg_img_red</item>
<item name="TextColor">@style/App_text_color_black</item>
<item name="android:imageButtonStyle">@style/image</item>
<item name="android:textViewStyle">@style/text</item>
</style>
<!-- RED Theme -->
<style name="NoteItTheme.RED">
<item name="pageBackgroundImage">@style/App_Bg_img_red</item>
<item name="android:textViewStyle">@style/App_text_color_black</item>
</style>
<style name="App_text_color_black" parent="@android:style/Widget.TextView" >
<item name="android:textColor">@color/Black</item>
</style>