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
  • 相关阅读:
    你应该知道的77条 Windows 7小技巧
    Platform Builder: Build Tools Intro
    JavaScript面向对象编程实现研究
    优秀驾驶员开车技巧
    WinCE BSP中的Dirs文件和Sources文件
    WinCE BSP中的Dirs文件和Sources文件
    WIX资源
    男性减肥方法!!!!!(转)
    Platform Builder: Sources.cmn
    批处理中的字符串处理详解
  • 原文地址:https://www.cnblogs.com/zhangxuechao/p/11779184.html
Copyright © 2011-2022 走看看