安卓第四周作业

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
   
   
    <Button
        android:id="@+id/a1"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_centerInParent="true"
        android:background="#FF7F24"
        />
   
    <Button
        android:id="@+id/a3"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_below="@id/a1"
        android:layout_alignRight="@+id/a1"
        android:background="#B8860B"
        />
   
    <Button
        android:id="@+id/a6"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_below="@id/a1"
        android:layout_toLeftOf="@+id/a1"
        android:background="#303030"
        />
   
    <Button
        android:id="@+id/a7"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_below="@id/a1"
        android:layout_toRightOf="@+id/a1"
        android:background="#0000FF"
        />
   
    <Button
        android:id="@+id/a8"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_toLeftOf="@id/a1"
        android:layout_alignBottom="@+id/a1"
        android:background="#A0522D"
        />
   
    <Button
        android:id="@+id/a9"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_toRightOf="@id/a1"
        android:layout_alignBottom="@+id/a1"
        android:background="#CD00CD"
        />
  
    <Button
        android:id="@+id/a5"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_above="@+id/a1"
        android:layout_toLeftOf="@+id/a1"
        android:background="#7CFC00" />
  
    <Button
        android:id="@+id/a4"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_alignBaseline="@+id/a5"
        android:layout_alignBottom="@+id/a5"
        android:layout_toLeftOf="@+id/a9"
        android:background="#969696" />
  
    <Button
        android:id="@+id/a2"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_alignBaseline="@+id/a4"
        android:layout_alignBottom="@+id/a4"
        android:layout_alignLeft="@+id/a9"
        android:background="#BF3EFF" 
 
posted @ 2020-11-23 19:25  mjmmmmmua  阅读(37)  评论(0编辑  收藏  举报