android权重android:layout_weight
来源:互联网 发布:怎么在淘宝注册品牌 编辑:程序博客网 时间:2024/05/21 17:27
android:layout_weight遵循数值越小,重要度越高的原则。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="300"
android:text="Button2" />
</LinearLayout>
<LinearLayout
android:layout_weight="2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button3" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="Button4" />
</LinearLayout>
<LinearLayout
android:layout_weight="2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button5" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1000"
android:text="Button6" />
</LinearLayout>
</LinearLayout>
效果如图
0 0
- android权重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中的Layout_weight(权重)详解
- Android之权重layout_weight的真正用法
- android:layout_weight权重的真实含义
- 剖析Android线性布局中 Layout_weight(权重)
- BUG:使用android:layout_weight权重导致对齐出错
- 剖析Android 线性布局中的权重(layout_weight)
- 剖析Android 线性布局中的权重(layout_weight)(解答疑惑)
- 剖析Android 线性布局中的权重(layout_weight)(解答疑惑)
- 透析Android 中 权重使用及分配规则(layout_weight)
- MVC过滤器详解和示例
- 详解三层架构图
- Search a 2D Matrix
- Windows下.vbs启动tomcat的bat示例
- Activity知识点总结
- android权重android:layout_weight
- 码农人生之程序员之路
- popen与pclose
- typedef
- Follow My Heart----大二下
- ADT下载地址(含各版本),最新ADT-23.0.6
- ZOJ-2060
- 。。。。。。。。。。
- SSH框架中的transaction即事务边界的问题