Java Android首选屏幕布局
我的应用程序中有以下首选项屏幕Java Android首选屏幕布局,java,android,xml,preferencescreen,Java,Android,Xml,Preferencescreen,我的应用程序中有以下首选项屏幕 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <EditTextPreference android:key="edittexvalue" android:id="@+id/edittextvalue" android:title="Title Here" android:summary="Summary Here" android:d
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<EditTextPreference
android:key="edittexvalue"
android:id="@+id/edittextvalue"
android:title="Title Here"
android:summary="Summary Here"
android:defaultValue="Some Value"/>
<Preference
android:key="customPref"
android:title="Title Here"
android:summary="Summary Here"/>
</PreferenceScreen>
所有这些都很好,但是我的应用程序我有自定义的背景和文本颜色/大小,但我不知道如何设置首选项屏幕的格式,我想你会把它指向另一个xml?但我无法理解我需要的代码以及应该做哪些更改。主要关注的是背景颜色,我想文本很好,但背景与我的应用程序的其他部分不匹配。所以我想设置一个自定义的背景色,比如现在的红色(#ff0000)
我感谢任何能帮助我解决这个问题的人例如,您可以在
清单
中对其应用主题
<activity android:name=".Settings"
android:theme="@style/YourStyle"/>
我希望这会有所帮助我没有考虑使用主题,但效果很好,谢谢!没问题,我很高兴这有帮助:)
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="YourStyle" parent="android:Theme.Light">
<item name="android:listViewStyle">@style/Widget.ListView</item>
<item name="android:windowNoTitle">true</item>
</style>
<style name="Widget" parent="android:Widget">
</style>
<style name="Widget.ListView">
<item name="android:background">@color/white</item>
<item name="android:divider">@color/gray_division</item>
<item name="android:dividerHeight">2dip</item>
</style>
</resources>