background
程序员文章站
2022-03-19 16:20:39
按钮 背景 -
按钮 背景 <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/control3_1" android:state_enabled="true" android:state_focused="true" android:state_pressed="false"/> <item android:drawable="@drawable/control3_1" android:state_enabled="true" android:state_pressed="true"/> <item android:drawable="@drawable/control3_1" android:state_checked="true" android:state_enabled="true"/> <item android:drawable="@drawable/control3_0"/> </selector>
check_box 背景
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/check_true1" android:state_checked="true"></item>
<item android:drawable="@drawable/check_true1" android:state_selected="true"></item>
<item android:drawable="@drawable/check_false1"></item>
</selector>
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true" android:state_pressed="true" android:drawable="@mipmap/link_check" /> <item android:state_checked="false" android:state_pressed="true" android:drawable="@mipmap/link_uncheck" /> <item android:state_checked="false" android:drawable="@mipmap/link_uncheck" /> <item android:state_checked="true" android:drawable="@mipmap/link_check" /> </selector>
单背景色 <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#3B87F6"/> <corners android:radius="6dp" /> </shape>
圆 背景色
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" android:useLevel="false"> <solid android:color="@color/background9"/> <stroke android:width="1dp" android:color="@color/background9" /> <size android:width="48dp" android:height="48dp" /> </shape>
背景渐变色
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="12dp" /> <gradient android:angle="0" android:startColor="#3F9BF0" android:endColor="#1C71E6" /> </shape>
图片旋转
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <rotate android:drawable="@drawable/loading_icon" android:fromDegrees="0.0" android:pivotX="50.0%" android:pivotY="50.0%" android:toDegrees="360.0"/> </item> </layer-list>
单线条边框背景 <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="10dp"/> <stroke android:width="1dp" android:color="@color/textcolor59" /> </shape>
本文地址:https://blog.csdn.net/qingchunqidewo/article/details/110518849
推荐阅读
-
CSS3之多背景background使用示例
-
CSS3之背景尺寸Background-size使用介绍
-
Css3之background-image的深层次理解
-
css3中background新增的4个新的相关属性用法介绍
-
Android8.0 java.lang.IllegalStateException: Not allowed to start service Intent app is in background
-
vue的style绑定background-image的方式和其他变量数据的区别详解
-
如何获取元素的最终background-color
-
纯css实现元素下出现横线动画(background-image)
-
CSS3中background-clip和background-origin的区别示例介绍
-
在css3中background-clip属性与background-origin属性的用法介绍