zoukankan      html  css  js  c++  java
  • 关于android LinearLayout的比例布局(转载)

    关于android LinearLayout的比例布局,主要有以下三个属性需要设置:

         1,android:layout_width,android:layout_height,android:layout_weight三个值

         2,当为水平布局时,android:layout_height=“0dp",当为垂直布局时,android:layout_width="0dp",android:layout_weight为所占比重。

         3,给个示例如下:

    <LinearLayout
                android:orientation="horizontal"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_weight="1">
                <TextView
                        android:layout_width="0dp"
                        android:layout_height="fill_parent"
                        android:layout_weight="1"
                        android:background="#aa0000"
                        android:gravity="center"
                        android:text="1111111111111111111111111111111111111111111"/>
                <TextView
                        android:layout_width="0dp"
                        android:layout_height="fill_parent"
                        android:layout_weight="2"
                        android:background="#00aa00"
                        android:gravity="center"
                        android:text="2"/>
                <TextView
                        android:layout_width="0dp"
                        android:layout_height="fill_parent"
                        android:layout_weight="3"
                        android:background="#0000aa"
                        android:gravity="center"
                        android:text="3"/>
        </LinearLayout>
    效果:

    原文摘自: http://blog.csdn.net/winson_jason/article/details/8444958

  • 相关阅读:
    struts2增删改查---layer---iframe层---通配符---国际化
    struts2增删改查---layer---iframe层
    struts2相关简单介绍
    直接在数据库客户端插入当前时间
    STL find() ,还是挺重要的
    两种应该掌握的排序方法--------1.shell Sort
    程序员的工具箱
    计算机科学中最重要的32个算法
    函数的重载与 泛型(generic)有什么不同?
    ruby编程语言-学习笔记5(第5章 语句和控制结构)
  • 原文地址:https://www.cnblogs.com/YangBinChina/p/3638093.html
Copyright © 2011-2022 走看看