• Android linearlayout常用布局


    用linearlayout完成这样的布局效果,这样的布局还是比较常用的,具体的xml代码如下:

    <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_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:layout_weight="1" >

    <Button
    android:id="@+id/button1"
    style="?android:attr/buttonStyleSmall"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button" />

    <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:gravity="right">

    <Button
    android:id="@+id/button2"
    style="?android:attr/buttonStyleSmall"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button" />

    </LinearLayout>

    </LinearLayout>

    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:layout_weight="1">

    <Button
    android:id="@+id/button3"
    style="?android:attr/buttonStyleSmall"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button" />

    </LinearLayout>

    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:gravity="bottom"
    >

    <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    >

    <Button android:id="@+id/button4" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /><LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:gravity="right" >

    <Button
    android:id="@+id/button5"
    style="?android:attr/buttonStyleSmall"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button" />
    </LinearLayout>

    </LinearLayout>

    </LinearLayout>

    </LinearLayout>

  • 相关阅读:
    C语言寒假大作战01
    C语言I作业12—学期总结
    C语言I博客作业11
    C语言I博客作业10
    C语言I博客作业09
    C语言I博客作业08
    计算机组成与设计 复习
    概率论与数理统计 期末复习
    SPM(Software Project Management)课程感想
    Software Project Management_JUnit && Maven
  • 原文地址:https://www.cnblogs.com/hyyweb/p/5133093.html
Copyright © 2020-2023  润新知