作业2

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <View
        android:id="@+id/view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:background="#48D1CC"
        tools:layout_editor_absoluteX="0dp"
        tools:layout_editor_absoluteY="0dp" />


    <Button
        android:id="@+id/white"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/green"
        android:layout_toLeftOf="@+id/black"
        android:minWidth="80dip"
        android:minHeight="80dip"
        android:background="#FFFFFF"
        tools:layout_editor_absoluteX="85dp"
        tools:layout_editor_absoluteY="250dp" />

    <Button
        android:id="@+id/purple"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBaseline="@+id/white"
        android:layout_alignBottom="@+id/white"
        android:layout_toRightOf="@+id/white"
        android:minWidth="80dip"
        android:minHeight="80dip"
        android:background="#EE6AA7"
        tools:layout_editor_absoluteX="165dp"
        tools:layout_editor_absoluteY="250dp" />

    <Button
        android:id="@+id/yello"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/deepblue"
        android:layout_alignLeft="@+id/deepblue"
        android:minWidth="80dip"
        android:minHeight="80dip"
        android:background="#FFFF00"

        tools:layout_editor_absoluteX="245dp"
        tools:layout_editor_absoluteY="250dp" />

    <Button
        android:id="@+id/green"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:minWidth="80dip"
        android:minHeight="80dip"
        android:layout_alignBaseline="@+id/black"
        android:layout_alignBottom="@+id/black"
        android:layout_toLeftOf="@+id/black"
        android:background="#008B45"
        tools:layout_editor_absoluteX="85dp"
        tools:layout_editor_absoluteY="330dp" />

    <Button
        android:id="@+id/black"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:minWidth="80dip"
        android:minHeight="80dip"
        android:background="#000000"
        tools:layout_editor_absoluteX="165dp"
        tools:layout_editor_absoluteY="330dp" />

    <Button
        android:id="@+id/deepblue"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBaseline="@+id/black"
        android:layout_alignBottom="@+id/black"
        android:layout_toRightOf="@+id/black"
        android:minWidth="80dip"
        android:minHeight="80dip"
        android:background="#191970"
        tools:layout_editor_absoluteX="245dp"
        tools:layout_editor_absoluteY="330dp" />

    <Button
        android:id="@+id/red"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/green"
        android:layout_toLeftOf="@+id/black"
        android:background="#CD0000"
        android:minWidth="80dip"
        android:minHeight="80dip"
        tools:layout_editor_absoluteX="85dp"
        tools:layout_editor_absoluteY="410dp" />

    <Button
        android:id="@+id/blue"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBaseline="@+id/green"
        android:layout_alignBottom="@+id/green"
        android:layout_toLeftOf="@+id/green"
        android:minWidth="80dip"
        android:minHeight="80dip"
        android:background="#00BFFF"
        tools:layout_editor_absoluteX="165dp"
        tools:layout_editor_absoluteY="410dp" />

    <Button
        android:id="@+id/green"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBaseline="@+id/red"
        android:layout_alignBottom="@+id/red"
        android:layout_toRightOf="@+id/black"
        android:minWidth="80dip"
        android:minHeight="80dip"
        android:background="#00FF7F"
        tools:layout_editor_absoluteX="245dp"
        tools:layout_editor_absoluteY="410dp" />


</android.support.constraint.ConstraintLayout>

 

转载于:https://www.cnblogs.com/ZERO-FLY/p/11460523.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值