【问题标题】:How to set Image in CheckBoxPreference如何在 CheckBoxPreference 中设置图像
【发布时间】:2016-01-23 01:08:19
【问题描述】:

我想将 4 个图像添加到首选项屏幕中的复选框首选项中。 要么 有什么方法可以让我将 4 张图像放在一行中,最后在首选项屏幕中的复选框。

【问题讨论】:

标签: android android-preferences android-sharedpreferences checkboxpreference


【解决方案1】:

试试这个:

custom_check.xml 文件

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-11-18
    • 2012-03-17
    • 2020-04-15
    • 1970-01-01
    • 2012-09-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多