checkbox文字和复选框的间距设置
来源:互联网 发布:linux的touch -r 编辑:程序博客网 时间:2024/06/05 09:33
原有的设置 在xml中
<CheckBox
android:id="@+id/login_remenber_pwd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/check_rond_selector"
android:text="记住密码"
android:textColor="@android:color/white"
android:paddingLeft="5dip"
/>
但发现发现在4.1和4.2的手机上效果不一样,4.1上的文字和复选框重叠了,而4.2上的效果是正常的。原来是两个版本的paddingleft计算方法不一样,4.1中没有加上图标的宽度,4.2以后中计算时加上了图标的宽度。因此 有两种方法解决。
一 判断手机版本号来设置 (比较麻烦)
if(getAndroidSDKVersion()<=16){
}
二 直接在xml文件中设置
<CheckBox
android:id="@+id/login_remenber_pwd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@null"
android:drawableLeft="@drawable/check_rond_selector"
android:drawablePadding="5dip"
android:text="记住密码"
android:textColor="@android:color/white"
android:paddingLeft="0dip"
/>
- checkbox文字和复选框的间距设置
- android中checkbox文字和复选框的间距设置问题
- CheckBox选择框和文字设置间距
- 一行代码搞定checkbox文字和复选框的图片间距问题 rediobutton同理
- checkbox 复选框文本和文字对齐
- CheckBox与文字的间距
- CheckBox与文字的间距
- CheckBox与文字的间距
- radiobutton 选择框和文字间距的设置方法
- android CheckBox和右侧文字间距问题
- checkbox设置复选框的只读效果
- 设置checkBox复选框的大小
- 复选框(checkbox)和单选框(radio)与文字居中对齐
- 复选框(checkbox)和单选框(radio)与文字居中对齐
- 单选框radio和复选框checkbox文字垂直居中问题
- 艰辛的路途checkbox文字间距
- [乐意黎]复选框(checkbox)和单选框(radio)与文字水平垂直居中对齐的解决方法
- 复选框(checkbox)和单选框(radio)与文字水平垂直居中对齐的解决方法
- wamp-------#1045 - Access denied for user 'root'@'localhost' (using password: NO)
- jquery ajax 参数意义
- leetcode-389. Find the Difference 字典,查找某个元素a不在list中
- 工具记录
- [转]程序员的十层楼
- checkbox文字和复选框的间距设置
- 为Python 3.5及以上安装Pygame模块
- 感知调用栈
- oracle 用户权限的管理
- OWASP 测试指南 4.0-OWASP 测试项目
- Idea,WebStorm,Phpstorm等IDE配色方案
- nodejs取参四种方法req.body,req.params,req.param,req.body
- linux的交叉编译工具说明
- 多线程实现文件复制