">
美文网首页
线性布局LinearLayout

线性布局LinearLayout

作者: _弓长_大人 | 来源:发表于2018-09-25 12:46 被阅读5次

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<TextView
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:text="hello world"
    android:gravity="center"
    android:textSize="10sp"
    android:layout_margin="10dp"
    android:layout_weight="1"
    android:background="#ff0000"/>
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="2"
    android:orientation="horizontal">
<TextView
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:text="hello world"
    android:gravity="center"
    android:textSize="20sp"
    android:layout_margin="10dp"
    android:layout_weight="1"
    android:background="#00ff00"/>
    <TextView
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:text="hello world"
        android:gravity="center"
        android:textSize="20sp"
        android:layout_margin="10dp"
        android:layout_weight="1"
        android:background="#00ff00"/>
    <TextView
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:text="hello world"
        android:gravity="center"
        android:textSize="20sp"
        android:layout_margin="10dp"
        android:layout_weight="1"
        android:background="#00ff00"/>



</LinearLayout>
<TextView
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:text="hello world"
    android:gravity="center"
    android:textSize="10sp"
    android:layout_margin="10dp"
    android:layout_weight="1"
    android:background="#00ff00"/>
<TextView
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:text="hello world"
    android:gravity="center"
    android:textSize="10sp"
    android:layout_margin="10dp"
    android:layout_weight="1"
    android:background="#0000ff"/>

</LinearLayout>

相关文章

  • 简单的Android界面创建

    线性布局 线性布局:LinearLayout控件特性:LinearLayout是一种ViewGroup,在其内部的...

  • 安卓原生页面布局总结

    布局分为线性布局:LinearLayout和相对布局:RelativeLayout 线性布局:LinearLayo...

  • Android布局控件-LinearLayout详解

    1.线性布局 LinearLayout LinearLayout简单来说就是线性布局,线性肯定是具有横竖两种方向的...

  • 第二周 三大基本布局

    *LinearLayout LinearLayout (线性布局)线性布局是按照水平或垂直的顺序将子元素(可以是控...

  • 四种基本布局

    一、LinearLayout LinearLayout 又称作线性布局,这个布局会将它所包含的控件在线性方向上依次...

  • Android学习笔记——常用布局

    一、布局 FrameLayout(框架布局) LinearLayout(线性布局) AbsoluteLayout(...

  • 2 布局

    LinearLayout(线性布局) RelativeLayout(相对布局) TableLayout(表格布局)...

  • 安卓(android)六大布局详解

    线性布局:(LinearLayout) 相对布局:(RelativeLayout) 帧布局:(FrameLayou...

  • 常用的五大布局

    常用的五大布局(线性布局,相对布局,帧布局,表格布局,绝对布局) 1,线性布局 LinearLayout ...

  • 2020-10-06

    Android常见界面布局:RelativeLayout(相对布局) LinearLayout(线性...

网友评论

      本文标题:线性布局LinearLayout

      本文链接:https://www.haomeiwen.com/subject/tycckftx.html