【发布时间】:2016-06-06 16:32:17
【问题描述】:
我正在尝试实现“设置”应用外观,这意味着我正在寻找在类别之间添加分隔符的解决方案。
所以我以为我找到了解决方案,但不幸的是它对我不起作用。正如建议的那样,我应该在布局中添加空首选项:
</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>
但我得到的只是空洞的偏好:
那我该如何解决呢?
【问题讨论】:
-
偏好类别之间的分界线。
-
设置应用中的图片显示了我想要的内容
-
以上布局你实现了吗?您能否包含阴影背景以提供完整的解决方案。
标签: android preferencefragment