当前位置: 首页 > news >正文

网站建设需要哪些素材东莞搜索网络优化

网站建设需要哪些素材,东莞搜索网络优化,嘉定企业网站制作,龙华附近网站建设layer-list layer-list ,layer,层,层次。list,列表。根据字面意思,我们大概能够理解到:在layer-list里面可以放很多item,每一个item之间会一层一层的叠放。 废话不多说,来几个实例就…

layer-list

  layer-list ,layer,层,层次。list,列表。根据字面意思,我们大概能够理解到:在layer-list里面可以放很多item,每一个item之间会一层一层的叠放。

  废话不多说,来几个实例就懂了。

(1)简单的图片层叠

 

1. 编写客户端代码

activity_main.xml

 1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 2     xmlns:tools="http://schemas.android.com/tools"
 3     android:layout_width="match_parent"
 4     android:layout_height="match_parent"
 5     tools:context="${relativePackage}.${activityClass}" >
 6 
 7     <ImageView
 8         android:layout_width="wrap_content"
 9         android:layout_height="wrap_content"
10         android:text="@string/hello_world"
11         android:background="@drawable/floor_drawable" />
12 
13 </RelativeLayout>

   客户端主要定义了一个ImageView,其它什么也没有。

2. 定义layer-list

在定义layer-list之前,我们首先需要两张图片

     +        =  

img_lev1.jpg              img_lev0.jpg

下面是代码:

my_drawable.xml

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
 3 
 4     <item
 5         android:id="@+id/user_face_drawable"
 6         android:drawable="@drawable/img_lev0">
 7     </item>
 8     <item
 9         android:id="@+id/user_faceback_drawable"
10         android:bottom="35.0dip"
11         android:drawable="@drawable/img_lev1"
12         android:left="10.0dip"
13         android:right="25.0dip"
14         android:top="18.0dip">
15     </item>
16 
17 </layer-list>

在layer-list中,定义了两个item,我们可以为每一个item指定id和drawable,其中left,right,top,bottom这四个属性决定了item的大小和位置。

(2)用layer-list定义阴影效果

效果图

客户端代码

activity_main.xml

 1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 2     xmlns:tools="http://schemas.android.com/tools"
 3     android:layout_width="match_parent"
 4     android:layout_height="match_parent"
 5     android:orientation="vertical" >
 6 
 7     <TextView
 8         android:layout_width="wrap_content"
 9         android:layout_height="wrap_content"
10         android:padding="5dp"
11         android:layout_margin="5dp"
12         android:text="@string/text"
13         android:lineSpacingMultiplier="1.3"
14         android:background="@drawable/my_drawable" />
15     <TextView
16         android:layout_width="wrap_content"
17         android:layout_height="wrap_content"
18         android:padding="5dp"
19         android:layout_margin="5dp"
20         android:text="@string/text"
21         android:lineSpacingMultiplier="1.3"
22         android:background="@drawable/my_drawable" />
23 
24 </LinearLayout>

my_drawable.xml

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
 3  
 4     <!-- 阴影部分 -->
 5     <!-- 个人觉得更形象的表达:top代表下边的阴影高度,left代表右边的阴影宽度。其实也就是相对应的offset,solid中的颜色是阴影的颜色,也可以设置角度等等 -->
 6     <item
 7         android:left="2dp"
 8         android:top="2dp">
 9         <shape android:shape="rectangle" >
10  
11             <gradient
12                 android:angle="270"
13                 android:endColor="#CC000000"
14                 android:startColor="#33333300" />
15  
16             <corners
17                 android:bottomLeftRadius="6dip"
18                 android:bottomRightRadius="6dip"
19                 android:topLeftRadius="6dip"
20                 android:topRightRadius="6dip" />
21         </shape>
22     </item>
23  
24     <!-- 背景部分 -->
25     <!-- 形象的表达:bottom代表背景部分在上边缘超出阴影的高度,right代表背景部分在左边超出阴影的宽度(相对应的offset) -->
26     <item
27         android:bottom="3dp"
28         android:right="3dp">
29         <shape android:shape="rectangle" >
30  
31             <gradient
32                 android:angle="270"
33                 android:endColor="#BBBBBB"
34                 android:startColor="#FFFFFF" />
35  
36             <corners
37                 android:bottomLeftRadius="6dip"
38                 android:bottomRightRadius="6dip"
39                 android:topLeftRadius="6dip"
40                 android:topRightRadius="6dip" />
41         </shape>
42     </item>
43  
44 </layer-list>

 

 

 

 

 

 

 

 

 

转载于:https://www.cnblogs.com/iuie/p/5095489.html

http://www.hkea.cn/news/833551/

相关文章:

  • 租用网站服务器东莞市网站建设
  • 馆陶县网站网站运营管理
  • 西双版纳傣族自治州医院seo搜索优化网站推广排名
  • wordpress站点网址小吃培训2000元学6项
  • 郑州网站制作天强科技seo百度发包工具
  • 江阴市住房与建设局网站seo工资多少
  • wordpress image.php南宁百度首页优化
  • 谢家华做网站百度指数与百度搜索量
  • wordpress 安装 ubuntu整站优化代理
  • 做公司网站协议书模板下载百度竞价推广公司
  • 福田蒙派克6座二手值多少钱重庆seo点击工具
  • 有了域名 怎么做网站外贸网站推广方法之一
  • 审美网站长春网站建设路
  • 网站 管理系统域名查询注册信息查询
  • 专业网站设计发展前景推广网站软文
  • 怎么建设seo自己网站网站优化推广教程
  • 最新app开发软件石家庄网站建设seo公司
  • 江苏自助建站系统哪家好推广网站要注意什么
  • 唐河做网站关键字搜索引擎
  • 松江专业做网站公司seo视频教程百度云
  • 淄博品质网站建设竞价推广怎么样
  • 搜狗站群系统资源网站优化排名优化
  • 建设一个网站哪家好网站推广优化的原因
  • 做网站的上海公司有哪些情感链接
  • 梧州做网站建设数字营销公司
  • 加强新闻网站建设建议seo高手培训
  • 安丘网站建设制作怎样制作网页设计
  • 食品网站建设优化案例热门职业培训班
  • 龙华新区做网站大地seo视频
  • 网站彩票投注员做啥的真正免费的网站建站平台运营