问题描述
在preference活动被调用膨胀
The preference activity gets inflated by invoking
添加preferencesFromResource(R.xml preferences);
和这里的preferences.xml:
and here are the preferences.xml:
<PreferenceCategory android:title="@string/pref_categ_update_label">
<ListPreference android:title="@string/pref_label"
android:key="update_interval"
android:entries="@array/update_names" android:entryValues="@array/update_values" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_categ_evernote_label">
<EditTextPreference android:title="@string/pref_dialog_edit_username"
android:key="prefUsername"
android:positiveButtonText="@string/save_pref"
android:negativeButtonText="@string/cancel_pref" />
<EditTextPreference android:title="@string/pref_dialog_edit_password"
android:key="prefPassword"
android:positiveButtonText="@string/save_pref"
android:negativeButtonText="@string/cancel_pref"
android:password="true" />
</PreferenceCategory>
一切看起来都不错,但EditText上preference项(2和3)旁边有箭头向下图标,就像列表preference(1)执行。为什么会这样,我怎么可以删除这些图标,因为它们看起来不相关?
everything looks okay, but EditTextPreference entries (2 and 3) have arrow-down icons next to them, just like ListPreference (1) does. Why is it so and how can I remove these icons as they look irrelevant?
该截图是在这里:
推荐答案
如果你不想在preferences的箭头,然后使用 -
If you dont want the arrows in preferences then use -
**android:widgetLayout="@null"**
如果你想给在preference右手边的一些自定义图像,然后使用 -
And if you want to give some custom image in preference right hand side then use -
**android:widgetLayout="@layout/pref_custom_image"**
其中, pref_custom_image.xml 的样子 -
<?xml version="1.0" encoding="utf-8"?>
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher"
/>
这篇关于安卓:如何去除下一个向下箭头图标的EditText preference进入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!