• 相对布局


    最常用属性:

     

    复制代码
    <?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">
    
        <View
            android:id="@+id/view_1"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="#000000"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true"/>
    
    </RelativeLayout>
    复制代码

    复制代码
    <?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">
    
        <View
            android:id="@+id/view_1"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="#000000" />
        <View
            android:id="@+id/view_2"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="#FF0033"
            android:layout_below="@id/view_1"/>
    </RelativeLayout>
    复制代码

    复制代码
    <?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">
    
        <View
            android:id="@+id/view_1"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="#000000" />
        <View
            android:id="@+id/view_2"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="#FF0033"
            android:layout_below="@id/view_1"/>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="200dp"
            android:layout_below="@id/view_2"
            android:orientation="horizontal"
            android:background="#0066FF"
            android:padding="15dp">
            <View
                android:layout_width="100dp"
                android:layout_height="match_parent"
                android:background="#FF0033"/>
            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#000000"
                android:padding="15dp">
                <View
                    android:id="@+id/view_3"
                    android:layout_width="100dp"
                    android:layout_height="match_parent"
                    android:background="#FF9900"/>
                <View
                    android:id="@+id/view_4"
                    android:layout_width="100dp"
                    android:layout_height="match_parent"
                    android:background="#FF9900"
                    android:layout_toRightOf="@id/view_3"
                    android:layout_marginLeft="10dp"/>
            </RelativeLayout>
    
        </LinearLayout>
    </RelativeLayout>
    复制代码
  • 相关阅读:
    STM32---GPIO
    SQLITE笔记
    STM32 ---- PWM
    STM32--- IIC使用
    TP配置apache下Rewrite模式
    韩顺平老师SNS数据库表 http://blog.csdn.net/zxman660/article/details/7786994
    HashMap和HashTable的区别http://blog.csdn.net/shohokuf/article/details/3932967
    HashMap和HashSet的区别http://www.importnew.com/6931.html
    在mysql中存储生日,php中计算今天是否为用户生日
    文件的MIME类型
  • 原文地址:https://www.cnblogs.com/1329197745a/p/14905145.html
Copyright © 2020-2023  润新知