技术标签: # Android原生开发系列 layer-list的属性 layer-list layer-list的属性和使用详解 Android
Android layer-list的属性和使用详解,layer-list是用来多个图层堆叠显示的,借这个特性可以做一些特别的效果(比如:阴影、下面的效果等),也可以投机取巧。
1.代码片
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!--最近的项目中需要用到多个图层堆叠到一块儿,就研
究了一下android中的layer-list。android中的layer-list
就是用来多个图层堆叠显示的。 -->
<item>
<shape > <!-- 第一层的颜色为蓝色 -->
<solid android:color="@color/blue"/>
</shape>
</item>
<!-- 第二层的颜色,也就是最上面的一层,因为第二层相对于
View的底部上移两个dp所以第一层会露出一个dp的黑色所以
给人一种只有底部边框的假象 -->
<item android:bottom="2dip">
<shape>
<solid android:color="@color/white"/>
</shape>
</item>
</layer-list>
2.布局代码和效果图 (一定要注意在使用RadioGroup的时候要记的写RadioButton的id,否则不能切换)
<RadioGroup
android:id="@+id/rg"
android:layout_below="@id/bt2"
android:layout_margin="10dip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rb0"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1"
android:button="@null"
android:text="分类"
android:checked="true"
android:gravity="center"
android:textColor="@color/black"
android:background="@drawable/ch_bg"
android:layout_marginTop="2dip"
android:paddingBottom="4dip"/>
<RadioButton
android:id="@+id/rb1"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1"
android:text="分类"
android:button="@null"
android:gravity="center"
android:textColor="@color/black"
android:background="@drawable/ch_bg"
android:layout_marginTop="2dip"
android:paddingBottom="4dip"/>
</RadioGroup>
选择器
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_checked="true" android:drawable="@drawable/bg_li"></item>
<item android:state_checked="false" android:drawable="@color/white"></item>
</selector>
3.代码片
<?xml version="1.0dip" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<bitmap android:src="@drawable/ic_launcher"
android:gravity="center"/>
</item>
<item android:left="10dip" android:top="10dip">
<bitmap android:src="@drawable/ic_launcher"
android:gravity="center"/>
</item>
<item android:left="20dip" android:top="20dip">
<bitmap android:src="@drawable/ic_launcher"
android:gravity="center"/>
</item>
<item android:left="30dip" android:top="30dip">
<bitmap android:src="@drawable/ic_launcher"
android:gravity="center"/>
</item>
</layer-list>
效果图
4.代码片
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/ic_launcher"></item>
<item android:left="10dip" android:top="10dip" android:drawable="@drawable/ic_launcher"></item>
<item android:left="20dip" android:top="20dip" android:drawable="@drawable/ic_launcher"></item>
<item android:left="30dip" android:top="30dip" android:drawable="@drawable/ic_launcher"></item>
</layer-list>
http://blog.csdn.net/brokge/article/details/9713041
http://www.aitinan.com/4004.html
http://www.cnblogs.com/tsoorr/p/3407935.html
http://www.cnblogs.com/ithouge/articles/ithouge-android-layer-list-shape-corners.html
http://www.linuxidc.com/Linux/2012-05/59827.htm
群辉开启NFS文件夹共享,linux系统挂载1.在群辉的控制面板-->共享文件夹新增一个共享文件夹NFSfile点击确定,授予相应用户权限,如图在NFS权限的选项卡设置NFS权限*代表所有主机可访问在控制面板-->文件服务下启用NFS文件服务,如图在客户端linux系统中安装NFS客户端工具yum install nfs-utils -y在linux中检测开启NFS服务...
登录注册带数据库编程小白第一次完成一个登录注册页面程序,找了很多大佬的代码,大都不全(看不懂),也不是类似老师教的风格。经过诸多努力,终于实现注册写入数据库以及登录,激动之余想起在网上找代码的心酸经历,特与朋友们分享,若有老鸟看到,请不吝指教,万分感谢!!!使用工具及包我使用的是SpringToolSuite4,mysql。需要用到的包:可以在网上找到下载,导入项目中。创建数据库...
导言2014 年,Google 公布开源项目 Kubernetes,它由 Joe Beda、Brendan Burns 以及 Craig McLuckie 带头创建,并于 2015 年 7 月 21 日正式发布 Kubernetes v1.0 版本。微软 Azure 在 2014 年便引入 Kubernetes 以及 libswarm,开发者可以在 Azure 上使用 Kubernetes
什么是卷积?如图:详细见卷积介绍。1x1的卷积如何实现模型压缩对于channel为1的图像,没有作用,对于大于1的图像就凸显作用了。举个例子,如图,输入图像是28x28x192,输出是28x28x32。如果卷积核为5x5x32时候,参数量是:(5x5x32 + 1)x 192 = 153792。中间加入一层1x1的卷积,降低输入的channel,再使用同样卷积核,参...
Miracl配置(作者:Baron_wu 禁止转载)(缺少cl命令的参照我的另一个博客:https://blog.csdn.net/Baron_wu/article/details/83151473)下载miracl压缩包解压,将miracl文件夹中的这些文件放到一起。运行ms64doit.bat在文件夹中会生成一个miracl.lib文件之后打开vs2017创建一个新的wi...
说明:1、本人的VS2015的安装路径是F:\VS2015。大家在看本教程时应根据自己的情况来操作。2、本教程提供了配置所需的全部库文件。库文件和测试程序下载地址: 链接:https://pan.baidu.com/s/1kVXMUm7 密码:zo36步骤:将"配置文件.rar"文件解压缩,得到dll、include和lib三个文件夹。将include文件夹里的所有...
dom diff:虚拟dom的对比算法就是一个函数,称之为patchpatchs = patch(旧的虚拟dom, 新的虚拟dom)patchs就是要运行的dom的最小操作Vue中的diff算法是经过优化的:只比较同一层级,不跨级比较比较标签名,如果标签名不同,直接删除,不继续深度比较如果标签名相同,看key是否相同,key相同就认为是相同节点,不进行深度比较例子:把虚拟dom想象成树形<div :class="x"> <span v-if="y
LAMP动态网站部署架构是由一套 Linux+Apache+MySQL+PHP 组成的动态网站系统解决方案.以下配置环境为:Linux=RHEL7 --> Apache=2.4.33 --> MySQL=5.5 --> PHP=7.0 无错误版.
题目描述恶魔猎手尤迪安野心勃勃,他背叛了暗夜精灵,率领深藏在海底的娜迦族企图叛变。守望者在与尤迪安的交锋中遭遇了围杀,被困在一个荒芜的大岛上。为了杀死守望者,尤迪安开始对这个荒岛施咒,这座岛很快就会沉下去。到那时,岛上的所有人都会遇难。守望者的跑步速度为17m/s,以这样的速度是无法逃离荒岛的。庆幸的是守望者拥有闪烁法术,可在1s内移动60m,不过每次使用闪烁法术都会消耗魔法值10点。守望者的...
//实验4.1:求赋权图中一个节点到所有节点得最短路径(无向图) #include <stdio.h>#include <stdlib.h>#define max 2000typedef struct MGraph{ int matrix[max][max];//邻接矩阵 int vernum; //节点数目}MGraph;void InitMGraph(MGraph *G);void FindShort(MGraph *G,int *D);.
为什么80%的码农都做不了架构师?>>> ...
华为这家企业对学历要求很高,.你培训的再好.也要看学校的. 目前华为刚刚涨薪,本科生月薪8K -10K 硕士 9K -11K 但是很难进.几乎不招本科生.如果你有N年工作经验也可以社招进去. 同时.我介绍下华为有多累.我在手机部门两年.深有感触. 我11年进公司,. 现在额头两边头发都掉了. 我们月末周六是固定加班的.我们晚上9点回家都不算加班.我们凌晨1点2点回家是常有的事情. 我们经常被主管黑.