Android layer-list:联合shape(2)

附录文章3简单说明了Android layer-list的用法,现在把Android layer-list联合shape做出一些特殊的应用,和附录文章3类似,先写布局文件:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="zhangphil.demo.MainActivity"> <TextView
android:layout_width="wrap_content"
android:layout_height="180dip"
android:layout_centerInParent="true"
android:background="@drawable/layer_list"
android:text="zhang phil @csdn"
android:gravity="center"
android:padding="10dip"
android:textColor="@android:color/white"/> </RelativeLayout>

布局文件的背景background里面用到layer-list(drawable/ layer_list.xml):

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item>
<shape>
<corners
android:bottomLeftRadius="40dip"
android:bottomRightRadius="40dip"
android:topLeftRadius="5dip"
android:topRightRadius="20dip" />
<solid android:color="@android:color/holo_red_light" /> <stroke
android:width="5dip"
android:color="@android:color/holo_blue_dark" />
</shape>
</item> <item android:drawable="@mipmap/ic_launcher"></item> </layer-list>

代码运行结果如图:

附录文章:

1,《Android AnimationDrawable动画与APP启动引导页面》链接地址:http://blog.csdn.net/zhangphil/article/details/47416915 


2,《Android ImageView的setImageLevel和level-list使用简介》链接地址:http://blog.csdn.net/zhangphil/article/details/48936209


3,《Android layer-list(1)》链接地址:http://blog.csdn.net/zhangphil/article/details/51720924

Android layer-list:联合shape(2)的更多相关文章

  1. [转]Android样式的开发:shape篇

    转载自Keegan小钢原文链接:http://keeganlee.me/post/android/20150830 Android样式的开发:shape篇Android样式的开发:selector篇A ...

  2. keep out layer PK board shape

    在进行设计pcb时,注意:板边线只能用PLACE LINE画线条,不能画具有电气性能的导线关于边界设置有三种,一.在 keepout layer 定义电气边界.二.design->board s ...

  3. Android样式的开发:shape篇

    转载请注明:转载自Keegan小钢并标明原文链接:http://keeganlee.me/post/android/20150830微信订阅号:keeganlee_me写于2015-08-30 And ...

  4. android 开发 xml绘制shape与Selector与layer-list 一 基础篇

    首先我们先来了解状态效果 android:state_pressed=["true" | "false"]  按下状态 android:state_focuse ...

  5. 浅谈Android样式开发之shape

    引言 在Android开发中我们很多情况都是使用图片来展示相关效果,今天我就来详细介绍下Android下使用Shape来进行简单UI的开发.一方面这些是Android开发的基础,另一方面这方面的知识可 ...

  6. 【Android进阶学习】shape和selector的结合使用(转)

    原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://liangruijun.blog.51cto.com/3061169/732310 ...

  7. Android开发教程:shape和selector的结合使用

    shape和selector是Android UI设计中经常用到的,比如我们要自定义一个圆角Button,点击Button有些效果的变化,就要用到shape和selector.可以这样说,shape和 ...

  8. Android:res之shape制作圆角、虚线、渐变

    xml控件配置属性 android:background="@drawable/shape" 标签 corners ----------圆角gradient ----------渐 ...

  9. Android之Selector、Shape介绍

    ------------整理自网络---------------------- <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns ...

随机推荐

  1. Spring Theme简单应用

    Spring MVC特性里由一个是关于Spring Theme主题的应用,所以写了个Demo 1.这里先看项目结构(Meven项目) 2.所需的POM依赖 <dependency> < ...

  2. VBScript+SCR+NetApi+Accoreconsole 批处理dwg文件

    继上次powershell运行accoreconsole(https://www.cnblogs.com/NanShengBlogs/p/10981687.html)的研究之后又觉得不是很合适,毕竟p ...

  3. No task executor bean found for async processing: no bean of type TaskExecut

    使用springcloud,添加异步方法后,调用异步成功,但有个 No task executor bean found for async processing: no bean of type T ...

  4. 51nod1265判断四点共面

    1265 四点共面 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题  收藏  关注 给出三维空间上的四个点(点与点的位置均不相同),判断这4个点是否在同一个平面内(4点共 ...

  5. Linux环境下安装JDK并配置环境变量

    首先查看是否已经安装了JDK并配置环境变量. [root@dhcc_plat opt]# java -version -bash: java: command not found [root@dhcc ...

  6. H5活动的一些事

    ISUX团队镇楼:https://isux.tencent.com/nine-question-of-swipe-html5-page.html IE6.7.8支持html5新元素 : http:// ...

  7. 什么是2MSL以及TIME_WAIT的作用

    TIME_WAIT主要是用来解决以下几个问题: 1)上面解释为什么主动关闭方需要进入TIME_WAIT状态中提到的: 主动关闭方需要进入TIME_WAIT以便能够重发丢掉的被动关闭方FIN包的ACK. ...

  8. swiper3初始化/swiper-init/用data实例化swiper/data-swiper

    Framework7直接用data属性实例化swiper用起来很爽,刚好最近又用到swiper插件,自己写一个 HTML <div class="swiper-container sw ...

  9. Python学习日记之中文支持

    解决中文输出错误 在开头添加 # -*- coding: utf-8 -*- 即可

  10. jboss之启动加载过程详解

    今天看了看jboss的boot.log和server.log日志,结合自己的理解和其他的资料,现对jboss的启动和加载过程做出如下总结: boot.xml是服务器的启动过程的日志,不涉及后续的操作过 ...