[英]Change ListPreference style
我想通過創建一個新style
來更改ListPreference
的默認圖像。
我通過繼承Widget.CompoundButton.CheckBox
並設置一個新的android:button
用CheckBoxPreference
Widget.CompoundButton.CheckBox
了,但我不知道如何在ListPreference
上做到這ListPreference
。
您可以使用WidgetLayout屬性在首選項中添加圖標。
例:
<EditTextPreference
android:defaultValue=""
android:dialogTitle="@string/mode_name"
android:key="mode_name"
android:order="0"
android:summary=""
android:title="@string/mode_name"
android:widgetLayout="@layout/mode_item_preference"
/>
和mode_item_preference.xml
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/app_name"
android:focusable="false"
android:src="@drawable/delete" />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.