如何解决列表偏好标题未显示标题为空
下面是 prefrence.xml 文件的代码,我设置了标题,但没有显示。 title="Select Shift Timings"
和 title="Select API"
不工作并且在图片上显示空白。这两个设置摘要显示较小的字体摘要但没有标题。其他标题按预期工作。
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:shoulddisableView="true"/>
<PreferenceCategory
android:shoulddisableView="true"/>
<PreferenceCategory
android:layout="@layout/preference_category_title"
android:title="USER">
<ListPreference
android:entries="@array/shift_names"
android:entryValues="@array/shift_names"
android:key="@string/preference_which_timing_to_use_key"
android:layout="@layout/preference"
android:title="Select Shift Timings" />
</PreferenceCategory>
<PreferenceCategory
android:layout="@layout/preference_category_title"
android:title="LOCATION">
<EditTextPreference
android:defaultValue="30"
android:inputType="number"
android:key="@string/preference_gps_updates_key"
android:summary="@string/pref_gps_updates_summary"
android:title="@string/pref_gps_updates" />
<EditTextPreference
android:defaultValue="8"
android:inputType="number"
android:key="@string/preference_max_run_time_key"
android:summary="@string/pref_max_run_time_summary"
android:title="@string/pref_max_run_time" />
<CheckBoxPreference
android:defaultValue="false"
android:key="@string/preference_timestamp_key"
android:summary="@string/pref_timestamp_summary"
android:title="@string/pref_timestamp" />
<CheckBoxPreference
android:defaultValue="false"
android:key="@string/preference_accuracy"
android:summary="@string/pref_gps_awake_explain"
android:title="@string/pref_gps_awake" />
<CheckBoxPreference
android:defaultValue="false"
android:key="@string/preference_stop_location_service"
android:summary="@string/pref_stop_location_service_explain"
android:title="@string/pref_stop_location_service" />
</PreferenceCategory>
<PreferenceCategory
android:layout="@layout/preference_category_title"
android:title="DEVELOPER OPTION">
<ListPreference
android:entries="@array/api_names"
android:entryValues="@array/api_names"
android:key="@string/preference_which_api_to_use_key"
android:layout="@layout/preference"
android:title="Select API" />
</PreferenceCategory>
</PreferenceScreen>
这是来自android studio的截图,但在真实的应用程序中也是这样显示的。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。