好的,这是驱使我笨蛋.要皮肤我的应用程序,我设置以下在我的主题:
<item name="android:textColor">#FFFFFF</item>
应用程序中的所有文本都将变为白色,除非我在布局xmls中手动覆盖它.太好了除了我的菜单选项中的文本(从列表和其他列表等)还决定变为白色.
这不是很好,因为白色白色很难读.我已经尝试了各种解决方案,包括搜索如何更改上下文菜单(无骰子)的文本颜色,并在我的主题中创建一个textAppearance项目.最后一个解决方案没有改变我的应用程序中的所有文本框,这是令人沮丧的.
那么,有什么建议吗?希望我的爱人很清楚.
解决方法
在您的styles.xml中,尝试覆盖textViewStyle,而不是只有所有textColor属性:
<style name="Theme.Blundell.Light" parent="@android:style/Theme.NoTitleBar"> <item name="android:windowBackground">@drawable/background_light</item> <item name="android:textViewStyle">@style/Widget.TextView.Black</item> </style> <style name="Widget.TextView.Black" parent="@android:style/Widget.TextView"> <item name="android:textColor">#000000</item> </style>
您甚至可以再进一步,只是覆盖某个视图的颜色,如按钮:
<style name="Widget.Holo.Button" parent="@android:style/Widget.Holo.Button"> <item name="android:textColor">#FFFFFF</item> </style> <style name="Theme.Blundell" parent="@android:style/Theme.Holo.NoActionBar"> <item name="android:colorBackground">@android:color/transparent</item> <item name="android:buttonStyle">@style/Widget.Holo.Button</item> </style>
如果您启发了更多的主题,请查看Android源代码,这是了解您可以做什么的最佳方式!
https://github.com/android/platform_frameworks_base/tree/master/core/res/res/values
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。