码迷,mamicode.com
首页 > 移动开发 > 详细

Android-LinearLayout布局技巧(二)

时间:2015-02-01 13:30:13      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:

先来看看图:

技术分享

布局代码:

 1     <?xml version="1.0" encoding="utf-8"?>  
 2     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
 3         android:layout_width="match_parent"  
 4         android:layout_height="match_parent"  
 5         android:orientation="horizontal" >  
 6         <LinearLayout   
 7             android:layout_width="wrap_content"  
 8             android:layout_height="20dp"  
 9             android:background="@color/green_light"  
10             android:layout_weight="1"  
11             >  
12         </LinearLayout>  
13           
14         <View   
15             android:layout_width="1dp"  
16             android:layout_height="20dp"  
17             android:background="@color/pink_light"  
18             />  
19           
20         <LinearLayout   
21             android:layout_width="wrap_content"  
22             android:layout_height="20dp"  
23             android:background="@color/blue_light"  
24             android:layout_weight="2"  
25             >  
26         </LinearLayout>  
27     </LinearLayout>  

 

此处,主要是权重中间可以加间隔

Android-LinearLayout布局技巧(二)

标签:

原文地址:http://www.cnblogs.com/royi123/p/4265399.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!