zoukankan      html  css  js  c++  java
  • Android第二次作业

    <?xml version="1.0" encoding="utf-8"?>
    <androidx.constraintlayout.widget.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">
    
        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello World!"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toTopOf="parent"/>
        <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#00FFFF">
            <Button
                    android:id="@+id/centerB"
                    android:layout_width="80dp"
                    android:layout_height="80dp"
                    android:background="#000000"
                    android:layout_centerInParent="true"></Button>
            <Button
                    android:id="@+id/leftB"
                    android:layout_width="80dp"
                    android:layout_height="80dp"
                    android:background="#006600"
                    android:layout_centerVertical="true"
                    android:layout_toLeftOf="@id/centerB"/>
            <Button
                    android:id="@+id/rightB"
                    android:layout_width="80dp"
                    android:layout_height="80dp"
                    android:background="#0000cd"
                    android:layout_centerVertical="true"
                    android:layout_toRightOf="@id/centerB"/>
            <Button
                    android:id="@+id/topB"
                    android:layout_width="80dp"
                    android:layout_height="80dp"
                    android:background="#FF1493"
                    android:layout_centerHorizontal="true"
                    android:layout_above="@id/centerB" />
            <Button
                    android:id="@+id/bottomB"
                    android:layout_width="80dp"
                    android:layout_height="80dp"
                    android:background="#4169E1"
                    android:layout_centerHorizontal="true"
                    android:layout_below="@id/centerB"/>
            <Button
                    android:layout_width="80dp"
                    android:layout_height="80dp"
                    android:background="#F8F8FF"
                    android:layout_above="@id/leftB"
                    android:layout_toLeftOf="@id/topB"/>
            <Button
                    android:layout_width="80dp"
                    android:layout_height="80dp"
                    android:background="#ff0000"
                    android:layout_below="@id/leftB"
                    android:layout_toLeftOf="@id/bottomB"/>
            <Button
                    android:layout_width="80dp"
                    android:layout_height="80dp"
                    android:background="#ffff00"
                    android:layout_above="@id/rightB"
                    android:layout_toRightOf="@id/topB"/>
            <Button
                    android:layout_width="80dp"
                    android:layout_height="80dp"
                    android:background="#00ff00"
                    android:layout_below="@id/rightB"
                    android:layout_toRightOf="@id/bottomB"/>
        </RelativeLayout>
    </androidx.constraintlayout.widget.ConstraintLayout>

    在安卓虚拟机上实现

    在自己手机上实现

  • 相关阅读:
    hdu 2014 青年歌手大奖赛_评委会打分
    java 图像灰度化与二值化
    hdu 2010
    如何搞定IE+google双内核的360浏览器表单自动回填兼容问题
    多预览小图焦点轮播插件lrtk
    多功能前台交互效果插件superSlide
    自适应标题延展线写法
    二级菜单延迟隐藏
    各种浏览器的Hack写法(chrome firefox ie等)
    jQuery treetable【表格多重折叠树功能及拖放表格子元素重新排列】
  • 原文地址:https://www.cnblogs.com/mengjia0513/p/11458602.html
Copyright © 2011-2022 走看看