android - 如何使复选框在 android 中看起来更好

标签 android android-layout checkbox

这是我的复选框的 XML:

<CheckBox
                android:id="@+id/atm_checkbox"
                android:layout_width="20dp"
                android:layout_height="20dp"
                android:background="@color/input_color" />

它看起来像这样:

http://imageshack.us/photo/my-images/528/47342915.png/

这是我在网上找到的:

<CheckBox
        android:id="@+id/chkAndroid"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/chk_android"
        android:checked="true" />

看起来像this

如何将我的复选框更改为看起来像我在互联网上找到的那个。 由于我的代表 <10,我无法上传我的复选框的图片,或者任何人都可以帮助我如何设计复选框以使其看起来更好

我认为这两个 xml 具有相似的代码,但为什么它们看起来如此不同?

最佳答案

如果您想要自定义复选框的外观,请参阅此 tutorial并找到一切。

顺便说一句,您链接中的复选框适用于Android3.0及更高版本。

关于android - 如何使复选框在 android 中看起来更好,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11045871/

相关文章:

android - Logcat 警告 :Drawable android:drawable/text_cursor_material has unresolved theme attributes

html - css 复选框在 :checked state 时不应用更改

android - 我可以以 root 身份启动 android intent 吗?

java - 协调器布局 : View disappears with custom behavior

android - Kotlin 中每个类只允许有一个伴生对象

android - 如何将按钮放入两个布局

javascript - 如何在 Knockout 中的选择选项中使用复选框

java - Struts 2 复选框 : What's the use of the value attribute when the fieldValue can only be true or false?

android - 当 AppBarLayout 滚动时,RecyclerView fling 会导致延迟

java - 在 FragmentTransaction 中使用 add().addToBackStack()、add().detach() 和 replace().addToBackStack() 有什么区别?