美文网首页Android studio
基本布局之一相对布局

基本布局之一相对布局

作者: deanwin | 来源:发表于2020-04-06 15:10 被阅读0次

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:layout_width="match_parent"

    android:layout_height="match_parent">

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_alignParentLeft="true"

        android:layout_alignParentTop="true"

        android:text="1"

        android:id="@+id/button1"

        />

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_alignParentRight="true"

        android:layout_alignParentTop="true"

        android:text="2"

        android:id="@+id/button2"

        />

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_centerInParent="true"

        android:text="3"

        android:id="@+id/button3"

        />

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_alignParentLeft="true"

        android:layout_alignParentBottom="true"

        android:text="4"

        android:id="@+id/button4"

        />

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_alignParentRight="true"

        android:layout_alignParentBottom="true"

        android:text="5"

        android:id="@+id/button5"

        />

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:text="7"

        android:id="@+id/button7"

        android:layout_above="@+id/button3"

        android:layout_toLeftOf="@+id/button3"

        android:layout_marginLeft="8dp"

        />

相关文章

  • android基础

    布局基本布局 FrameLayout线性布局 LinearLayout相对布局 RelativeLayout绝对布...

  • 基本布局之一相对布局

  • Android 六大基本布局

    1.android 六大基本布局: 线性布局LinearLayou、相对布局RelativeLayout、表格布局...

  • Android 常见布局

    基本理论 Android六大基本布局分别是:线性布局LinearLayout、表格布局TableLayout、相对...

  • 基本布局之RelativeLayout 相对布局

    RelativeLayout 相对布局, 是非常常用的布局. 它可以让控件出现在任何位置. 先来一个实例: 效果:...

  • 布局 - 相对布局

    RelativeLayout 相对布局 相对布局也是一种非常常用的布局,它可以通过相对定位的方式让控件出现在任何位...

  • android第四课。

    今天学习了两种布局方式。一种是线性布局,另一种是相对布局。 线性布局: 相对布局: 相对布局 图标要选择对齐方式

  • CSS之浮动元素影响清除方法归纳

    前言 浮动是CSS的三种基本定位机制之一,在现在网页的DIV+CSS基本布局中,无论是两列布局,三列布局,多列布局...

  • Android之6大布局

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

  • 2 布局

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

网友评论

    本文标题:基本布局之一相对布局

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