android listPreferences xml中的条目和条目值有什么区别?

这是我的代码

它们如何不同以及哪些值会显示在对话框中?

<ListPreference
    android:entryValues="@array/level"
    android:entries="@array/level"
    android:key="pref_numberOfChoices"
    android:persistent="true"
    android:summary="@string/level_description"
    android:title="@string/level_title"
    android:defaultValue="3"/>

解决方法

你可以查看关于 ListPreference的官方文档.

android:entries The human-readable array to present as a list.

android:entryValues The array to find the value to save for a
preference when an entry from entries is selected.

换句话说:条目是您在列表中看到的条目,entryValues是您在使用相应条目值执行某些操作时要保存的值.

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...