通过View 的android:layout_weight属性占用多余的空间
来源:互联网 发布:kindlepc阅读软件 编辑:程序博客网 时间:2024/05/01 17:43
通过 <View android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.0"/>
设置占用多余的空间
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:layout_marginTop="10dip"
android:orientation="horizontal">
<ImageView
android:id="@+id/expend_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="10dip" />
<TextView
android:id="@+id/type_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:singleLine="true"
android:textColor="@color/text_color"
android:textSize="15dip" />
<!--通过这个设置占用多余的空间 -->
<View android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.0"/>
<TextView
android:id="@+id/date_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="right"
android:layout_marginRight="10dip"
android:gravity="center_vertical"
android:textColor="@color/text_color"
android:textSize="15dip" />
</LinearLayout>
上面的布局效果一般是用来设置类似于相对布局界面效果,特别是布局方向是水平(horizonta)的时候。当使用相对布局的时候,相对布局容器里面有一些元素需要变换隐藏或者消失的话,此时就可以用linearlayout替代相对布局。
- 通过View 的android:layout_weight属性占用多余的空间
- android:layout_weight属性的使用
- android:layout_weight属性的使用
- Android的layout_weight属性详解
- Android的layout_weight属性释疑
- Android布局的layout_weight属性
- android Layout_weight属性的详解
- 对android的layout_weight属性的理解
- 对android的layout_weight属性的理解
- android中如何在代码中直接设置View的layout_weight属性
- android中如何在代码中直接设置View的layout_weight属性
- android中如何在代码中直接设置View的layout_weight属性
- android中如何在代码中直接设置View的layout_weight属性
- android中如何在代码中直接设置View的layout_weight属性
- android中如何在代码中直接设置View的layout_weight属性
- android中如何在代码中直接设置View的layout_weight属性
- 详解 Android Views 元素的 layout_weight 属性
- Android布局属性Layout_weight的标准解释
- ANE Toolkit
- MFC中IPADDRESS控件的使用
- 你好吗
- 理财专题(8)——典当行
- Jquery menu 插件
- 通过View 的android:layout_weight属性占用多余的空间
- 静态链接库与动态链接库
- Delphi中TDateTime使用心得
- 在MyEclipse中配置Tomcat服务器
- $("parent > child")、$("A B")、$("div#test")、$("div,#test")、$(".test","div")
- 盘点黑客攻击途径:最常用的7个策略及简单的防护方法
- android未捕获异常的处理方法
- JAVA虚拟机--小结
- 文本编辑器代码分析(续2)