0
我想將4圖像添加到首選項屏幕中的複選框首選項。 或 它是任何方式,以便我可以將4圖像放在一行中,並在最終選擇框中的複選框。如何在CheckBoxPreference中設置圖像
我想將4圖像添加到首選項屏幕中的複選框首選項。 或 它是任何方式,以便我可以將4圖像放在一行中,並在最終選擇框中的複選框。如何在CheckBoxPreference中設置圖像
試試這個:
custom_check.xml FILE
<?xml version="1.0" encoding="UTF-8"?>
<CheckBox
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+android:id/checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:clickable="false"
android:button="@drawable/android_button"/>
佈局。
<CheckBoxPreference
android:key="@string/Drop_Option"
android:title="XXXXX"
android:defaultValue="true"
android:widgetLayout="@layout/custom_check"/>
看到下面的鏈接,幫助它會給你idea- [http://stackoverflow.com/questions/3569412/customize-check-box-preference](http://stackoverflow.com/questions/3569412 /定製-複選框偏好) – sud