zoukankan      html  css  js  c++  java
  • Android 相对布局 RelativeLayout

    <!-- 在main元素的上方 -->
    android:layout_above="@+id/main"
    <!-- 在main元素的下方 -->
    android:layout_below="@+id/main"
    <!-- 在main元素的左边 -->
    android:layout_toLeftOf="@+id/main"
    <!-- 在main元素的右边 -->
    android:layout_toRightOf="@+id/main"
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        tools:context=".MainActivity" >
    
        <Button
            android:id="@+id/button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:text="button" />
    
        <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_above="@+id/button"
            android:layout_toLeftOf="@+id/button"
            android:text="button1" />
    
        <Button
            android:id="@+id/button2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_above="@+id/button"
            android:layout_toRightOf="@+id/button"
            android:text="button2" />
    
        <Button
            android:id="@+id/button3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/button"
            android:layout_toLeftOf="@+id/button"
            android:text="button3" />
    
        <Button
            android:id="@+id/button4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/button"
            android:layout_toRightOf="@+id/button"
            android:text="button4" />
    
    </RelativeLayout>
    image
  • 相关阅读:
    新数学丛书《连分数》 习题 1.1
    连分数中一个有意思的小玩意儿
    无聊博文之:用同余的语言阐述欧几里德算法
    有向无环图
    Codeforces Round #658 (Div. 2)
    常用代码模板3——搜索与图论
    什么是动态规划?动态规划的意义是什么?(转自知乎)
    Codeforce:4C. Registration system (映射)
    C++与正则表达式入门
    常用代码模板4——数学知识
  • 原文地址:https://www.cnblogs.com/zhangxuechao/p/11779184.html
Copyright © 2011-2022 走看看