zoukankan      html  css  js  c++  java
  • 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>

  • 相关阅读:
    .net下将富文本编辑器文本原样读入word文档
    最大流算法完整代码
    如何用程序删除win 7下SYSTEM权限的目录
    01背包问题的动态规划算法
    使用gem安装jekyll错误记录
    dev机上数据库中批量生成table
    git pull错误记录及解决
    git clone操作到开发机的错误记录
    nginx错误记录
    链表链式结构的写法
  • 原文地址:https://www.cnblogs.com/hyyweb/p/5133093.html
Copyright © 2011-2022 走看看