问题描述
下面是 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 (将#修改为@)