• 安卓第四周作业


    第四周安卓作业

    1.九宫格

     1 <?xml version="1.0" encoding="utf-8"?>
     2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     3     android:layout_width="match_parent"
     4     android:layout_height="match_parent">
     5 
     6     <Button
     7         android:id="@+id/button1"
     8         android:layout_width="100dp"
     9         android:layout_height="100dp"
    10         android:background="#000000"
    11         android:layout_centerInParent="true"
    12         android:text=""
    13         />
    14 
    15     <Button
    16         android:id="@+id/button2"
    17         android:layout_width="100dp"
    18         android:layout_height="100dp"
    19         android:background="#0000FF"
    20         android:layout_toLeftOf="@id/button1"
    21         android:layout_centerInParent="true"
    22         android:text=""
    23         />
    24     <Button
    25         android:id="@+id/button3"
    26         android:layout_width="100dp"
    27         android:layout_height="100dp"
    28         android:background="#FF0000"
    29         android:layout_toRightOf="@id/button1"
    30         android:layout_centerInParent="true"
    31         android:text=""
    32         />
    33     <Button
    34         android:id="@+id/button4"
    35         android:layout_width="100dp"
    36         android:layout_height="100dp"
    37         android:background="#00FF00"
    38         android:layout_above="@id/button1"
    39         android:layout_centerInParent="true"
    40         android:text=""
    41         />
    42     <Button
    43         android:id="@+id/button5"
    44         android:layout_width="100dp"
    45         android:layout_height="100dp"
    46         android:background="#FFFF00"
    47         android:layout_toLeftOf="@+id/button4"
    48         android:layout_above="@id/button2"
    49         android:layout_centerInParent="true"
    50         android:text=""
    51         />
    52     <Button
    53         android:id="@+id/button6"
    54         android:layout_width="100dp"
    55         android:layout_height="100dp"
    56         android:background="#00FFFF"
    57         android:layout_toRightOf="@+id/button4"
    58         android:layout_above="@id/button3"
    59         android:layout_centerInParent="true"
    60         android:text=""
    61         />
    62     <Button
    63         android:id="@+id/button7"
    64         android:layout_width="100dp"
    65         android:layout_height="100dp"
    66         android:background="#FF0FFF"
    67         android:layout_below="@id/button1"
    68         android:layout_centerInParent="true"
    69         android:text=""
    70         />
    71     <Button
    72         android:id="@+id/button8"
    73         android:layout_width="100dp"
    74         android:layout_height="100dp"
    75         android:background="#0FFFFF"
    76         android:layout_below="@id/button2"
    77         android:layout_toLeftOf="@id/button7"
    78         android:layout_centerInParent="true"
    79         android:text=""
    80         />
    81     <Button
    82         android:id="@+id/button9"
    83         android:layout_width="100dp"
    84         android:layout_height="100dp"
    85         android:background="#FFFF00"
    86         android:layout_toRightOf="@+id/button4"
    87         android:layout_below="@id/button3"
    88         android:layout_centerInParent="true"
    89         android:text=""
    90         />
    91 
    92 </RelativeLayout>

    2.QQ登录界面

     1 <?xml version="1.0" encoding="utf-8"?>
     2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     3     android:layout_width="match_parent"
     4     android:layout_height="match_parent"
     5     android:background="#E6E6E6"
     6     android:orientation="vertical">
     7 
     8     <ImageView
     9         android:id="@+id/iv"
    10         android:layout_width="70dp"
    11         android:layout_height="70dp"
    12         android:layout_centerHorizontal="true"
    13         android:layout_marginTop="40dp"
    14         android:background="@drawable/head"/>
    15 
    16     <LinearLayout
    17         android:id="@+id/l1_number"
    18         android:layout_width="match_parent"
    19         android:layout_height="wrap_content"
    20         android:layout_below="@+id/iv"
    21         android:layout_centerVertical="true"
    22         android:layout_marginBottom="5dp"
    23         android:layout_marginLeft="10dp"
    24         android:layout_marginRight="10dp"
    25         android:layout_marginTop="15dp"
    26         android:background="#FFFFFF">
    27 
    28         <TextView
    29             android:id="@+id/tv_number"
    30             android:layout_width="wrap_content"
    31             android:layout_height="wrap_content"
    32             android:padding="10dp"
    33             android:text="账号:"
    34             android:textColor="#000"
    35             android:textSize="20sp"/>
    36 
    37         <EditText
    38             android:id="@+id/et_number"
    39             android:layout_width="match_parent"
    40             android:layout_height="wrap_content"
    41             android:layout_marginLeft="5dp"
    42             android:background="@null"
    43             android:padding="10dp"/>
    44     </LinearLayout>
    45 
    46     <LinearLayout
    47         android:id="@+id/l1_password"
    48         android:layout_width="match_parent"
    49         android:layout_height="wrap_content"
    50         android:layout_below="@+id/l1_number"
    51         android:layout_centerVertical="true"
    52         android:layout_marginLeft="10dp"
    53         android:layout_marginRight="10dp"
    54         android:background="#FFFFFF">
    55 
    56         <TextView
    57             android:id="@+id/tv_password"
    58             android:layout_width="wrap_content"
    59             android:layout_height="wrap_content"
    60             android:padding="10dp"
    61             android:text="密码:"
    62             android:textColor="#000"
    63             android:textSize="20sp"/>
    64 
    65         <EditText
    66             android:id="@+id/et_password"
    67             android:layout_width="match_parent"
    68             android:layout_height="wrap_content"
    69             android:layout_marginLeft="5dp"
    70             android:layout_toRightOf="@id/tv_password"
    71             android:background="@null"
    72             android:inputType="textPassword"
    73             android:padding="10dp"/>
    74 
    75     </LinearLayout>
    76     <Button
    77         android:id="@+id/btn_login"
    78         android:layout_width="match_parent"
    79         android:layout_height="wrap_content"
    80         android:layout_below="@+id/l1_password"
    81         android:layout_marginLeft="10dp"
    82         android:layout_marginRight="10dp"
    83         android:layout_marginTop="50dp"
    84         android:background="#3c8dc4"
    85         android:text="登录"
    86         android:textColor="#FFFFFF"
    87         android:textSize="20sp"/>
    88 
    89 </RelativeLayout>

  • 相关阅读:
    微服务迁移记(七):使用docker发布 springcloud应用
    intelliJ IDEA docker部署springboot项目
    docker部署应用时超时解决
    centos下docker安装
    freemarker自定义分页(springboot、bootstrap4)
    微服务迁移记(六):集成jwt保护微服务接口安全
    微服务迁移记(五):WEB层搭建(5)-集成ueditor编辑器,伪分布式图片上传
    微服务迁移记(五):WEB层搭建(4)-简单的权限管理
    微服务迁移记(五):WEB层搭建(3)-FreeMarker集成
    WebView使用input file控件打开相册上传图片
  • 原文地址:https://www.cnblogs.com/wuhaoovo/p/13697295.html
Copyright © 2020-2023  润新知