2012-07-25 12 views
5

Chcę zmienić domyślny obraz ListPreference, tworząc nowy style.Zmień listę Styl subskrypcji

Zrobiłem to z CheckBoxPreference przez dziedziczyć Widget.CompoundButton.CheckBox i ustanawiając nowy android:button, ale nie wiem jak to zrobić na ListPreference.

Odpowiedz

1

Możesz dodać ikonę w preferencji, używając właściwości WidgetLayout.

przykład:

<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" 
    /> 

A 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" /> 
Powiązane problemy