首页 > 解决方案 > Android4.0是否支持Android复选框属性“android:button”?

问题描述

我正在 xml 文件中测试 Checkbox 的属性 android:button 。新样式在Android6.0下运行良好,但在Android4.0仍显示默认样式。我检查了 API 级别 1 中添加的 StateListDrawable。为什么这个属性在 Android4.0 中不起作用。

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:button="@mipmap/ic_launcher_round"/>

或者

<CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:button="@drawable/state_list_xml"/>

两种方式的结果与我上面描述的相同。

标签: android

解决方案


推荐阅读