列表偏好标题未显示标题为空

问题描述

下面是 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的截图,但在真实的应用程序中也是这样显示的。

Happening wth 2 titles only

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...