2012-07-25 28 views
5

मैं एक नया style बनाकर ListPreference की डिफ़ॉल्ट छवि को बदलना चाहता हूं।सूची बदलें संदर्भ शैली

मैं इनहेरिट Widget.CompoundButton.CheckBox द्वारा एक CheckBoxPreference और एक नया android:button स्थापित करने के साथ यह किया है, लेकिन मैं कैसे एक ListPreference पर यह करने के लिए पता नहीं है।

उत्तर

1

आप विजेटलेआउट संपत्ति का उपयोग कर वरीयता में एक आइकन जोड़ सकते हैं।

उदाहरण:

<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" /> 
संबंधित मुद्दे