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>

  • 相关阅读:
    SqlMap入门
    本地文件上载到Docker容器
    CentOS7 安装Docker-ce
    windows10 子系统(WSL) 文件位置
    慕课网-安卓工程师初养成-5-1 编程练习
    慕课网-安卓工程师初养成-4-14 Java 循环语句之多重循环
    慕课网-安卓工程师初养成-4-13 练习题
    慕课网-安卓工程师初养成-4-12 Java循环跳转语句之 continue
    慕课网-安卓工程师初养成-4-11 Java循环跳转语句之 break
    慕课网-安卓工程师初养成-4-10 练习题
  • 原文地址:https://www.cnblogs.com/hyyweb/p/5133093.html
Copyright © 2011-2022 走看看