我正在尝试实现设置应用程序外观,这意味着我正在寻找在类别之间添加分隔符的解决方案.
所以我以为我找到了解决办法,但不幸的是,这对我不起作用.正如所建议的那样,我应该添加布局的空偏好:
</PreferenceCategory>
<Preference
android:title="Test"
android:summary="Summary"/>
</PreferenceCategory>
<Preference layout="@layout/divider_preference" />
<PreferenceCategory
android:title="Category"/>
Run Code Online (Sandbox Code Playgroud)
这是分隔符:
<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>
Run Code Online (Sandbox Code Playgroud)
但我得到的只是空的偏好:
那我怎么能解决这个问题呢?