Android CheckBox修改大小、边框颜色,以及自定义CheckBox;

CheckBox修改大小:

1android:scaleX="0.8" 2android:scaleY="0.8"

CheckBox修改边框颜色,注意不是背景色:

 android:buttonTint="@color/colorAccent"

修改大小和边框颜色:

1 <CheckBox 2 android:layout_width="wrap_content" 3 android:layout_height="match_parent" 4 android:gravity="center_vertical" 5 android:scaleX="0.8" 6 android:scaleY="0.8" 7 android:buttonTint="@color/colorAccent" 8 />

自定义CheckBox:

1 <CheckBox 2 android:id="@+id/spc_cb_shops" 3 android:layout_width="wrap_content" 4 android:layout_height="match_parent" 5 android:paddingLeft="@dimen/side_distance" 6 android:paddingRight="@dimen/side_distance" 7 style="@style/spc_checkbox_style" 8 /> 9 10 <!--购物车checkbox--> 11 <style name="spc_checkbox_style" parent="@android:style/Widget.CompoundButton.CheckBox"> 12 <item name="android:drawableLeft">@drawable/spc_cb</item> 13 <item name="android:button">@null</item> 14 </style> 15 16<?xml version="1.0" encoding="utf-8"?> 17<selector xmlns:android="http://schemas.android.com/apk/res/android"> 18 <item android:state_checked="true" android:drawable="@mipmap/select_button" /> 19 <item android:state_checked="false" android:drawable="@mipmap/select_button_gray" /> 20 <item android:drawable="@mipmap/select_button_gray" /> 21</selector> 22 23@mipmap/select_button是已选中样式,; 24 25@mipmap/select_button_gray是未选中样式;
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

C# WinForm窗体控件Panel修改边框颜色以及边框宽度方法

CWinForm窗体控件Panel修改边框颜色以及边框宽度方法1.新建组件这里可以自定义一个Panel控件起名为PanelEx !(https://oscimg.oschina.net/oscnet/99045

KVM调整cpu和内存

一.修改kvm虚拟机的配置1、virsheditcentos7找到“memory”和“vcpu”标签,将<namecentos7</name<uuid2220a6d1a36a4fbb8523e078b3dfe795</uuid

Android So动态加载 优雅实现与原理分析

背景:漫品Android客户端集成适配转换功能(基于目标识别(So库35M)和人脸识别库(5M)),导致apk体积50M左右,为优化客户端体验,决定实现So文件动态加载.!(https://oscimg.oschina.net/oscnet/00d1ff90e4b34869664fef59e3ec3fdd20b.png)点击上方“蓝字”关注我