我想要实现设置应用程序的外观,这意味着我正在寻找在类别之间添加分隔符的解决方案。
所以我认为我找到了解决方案,但不幸的是它对我不起作用。正如建议的那样,我应该添加一个带有布局的空首选项:</PreferenceCategory>
<Preference
android:title="Test"
android:summary="Summary"/>
</PreferenceCategory>
<Preference layout="@layout/divider_preference" />
<PreferenceCategory
android:title="Category"/>
这里是分隔符:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="10dp"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="@drawable/shadow_bottom"/>
<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="@drawable/shadow_top"/>
</LinearLayout>
但我得到的只是空白的偏好设置:
那我该怎么解决呢?