如何降低CheckBox的宽度和高度的Andr​​oid [英] How to decrease the Width and Height of CheckBox in Android

查看:433
本文介绍了如何降低CheckBox的宽度和高度的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我如何降低CheckBox的宽度和高度,以便在Android中显示非常小的CheckBox?

Can anyone tell me how to reduce the width and height of CheckBox in order to display very small CheckBox in Android ?

在预先感谢

推荐答案

setWidth(INT)自动调用setHeight(INT),因为复选框扩展 CompoundButton 延伸按钮

尝试参照本教程

Alernatively尝试通过XML改变它:

Alernatively try changing it via the XML:

<CheckBox 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"
    android:text="new checkbox" 
    android:background="@drawable/my_checkbox_background"
    android:button="@drawable/my_checkbox" />

这篇关于如何降低CheckBox的宽度和高度的Andr​​oid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆