我有以下偏好列表。
<ListPreference
android:key="@string/settings_key_keyboard_theme_key"
android:title="@string/select_skin"
android:entries="@array/select_keyboard_skin"
android:entryValues="@array/the_value_of_keyboard_skin"
android:dialogTitle="@string/select_skin"
android:defaultValue="@string/settings_default_keyboard_theme_key" />
<string-array name="select_keyboard_skin">
<item>White</item>
<item>Black</item>
<item>Wood</item>
<item>Beige</item>
<item>Leather</item>
<item>Purple</item>
<item>Blackberry</item>
</string-array>
我想用图片图标替换某些项目的单选按钮。例如,它可能是这样的:
If(Item == White || Black || Wood){
(RadioButton).SetVisbility(Invisible)
(ImageButton).SetVisibility(Visible)
}
我是List Preference Activity的新手。请提一些建议吗?
答案 0 :(得分:1)
您必须延长ListPreference
并覆盖onPrepareDialogBuilder(Builder)
和OnCreateDialogView()
看到这个:Ho to customize list preference radio button