zoukankan      html  css  js  c++  java
  • Android第四周作业

    九宫格

    <?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"
        android:orientation="vertical">
    
        <Button
            android:id="@+id/one"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="#00868B"
            android:layout_centerInParent="true" />
    
        <Button
            android:id="@+id/two"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="#2E8B57"
            android:layout_alignBottom="@+id/one"
            android:layout_toLeftOf="@+id/one"/>
    
        <Button
            android:id="@+id/three"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="#6495ED"
            android:layout_alignBottom="@+id/one"
            android:layout_toRightOf="@+id/one"/>/>
    
        <Button
            android:id="@+id/four"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="#EEAD0E"
            android:layout_alignLeft="@+id/one"
            android:layout_above="@+id/one"/>
    
        <Button
            android:id="@+id/five"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="#8B658B"
            android:layout_alignLeft="@+id/one"
            android:layout_below="@+id/one"/>/>
    
        <Button
            android:id="@+id/six"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="#FF6A6A"
            android:layout_alignLeft="@+id/two"
            android:layout_above="@+id/one"/>/>
    
        <Button
            android:id="@+id/seven"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="#8B4513"
            android:layout_alignLeft="@+id/two"
            android:layout_below="@+id/one"/>/>
    
        <Button
            android:id="@+id/eight"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="#FF69B4"
            android:layout_alignLeft="@+id/three"
            android:layout_above="@+id/one"/>/>
    
        <Button
            android:id="@+id/nine"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="#8B8682"
            android:layout_alignLeft="@+id/three"
            android:layout_below="@+id/one"/>/>
    
    </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">
    
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@mipmap/ic_launcher"
        android:layout_marginTop="150dp"
        android:layout_centerHorizontal="true"/>
    
    <EditText
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        android:text="请输入用户名:"
        android:layout_marginTop="250dp"
        android:layout_centerHorizontal="true"/>
    
    <EditText
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        android:text="请输入用户名:"
        android:layout_marginTop="300dp"
        android:layout_centerHorizontal="true"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="50dp"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="350dp"
        android:text="登录"
        android:onClick="click"/>
    </RelativeLayout>

  • 相关阅读:
    C#Redis缓存帮助类
    [RxSwift教程]9、过滤操作符:filter、take、skip等
    [RxSwift教程]8、变换操作符:buffer、map、flatMap、scan等
    [RxSwift教程]7、Subjects、Variables
    [RxSwift教程]6、观察者2: 自定义可绑定属性
    [RxSwift教程]5、观察者1: AnyObserver、Binder
    [RxSwift教程]4、Observable订阅、事件监听、订阅销毁
    [RxSwift教程]3、Observable介绍、创建可观察序列
    [RxSwift教程]2、响应式编程与传统式编程的比较样例
    [RxSwift教程]1、安装、介绍
  • 原文地址:https://www.cnblogs.com/student-yyh/p/13697538.html
Copyright © 2011-2022 走看看