第一次结对作业(2023.3.21)

发布时间 2023-03-22 21:11:02作者: 摆烂达人

今日完成安卓app端页面,以及跳转页面的设计,修改布局及其相关内容。

以下为相关截图

 

 

 

 

 

 以下为相关代码,布局页面以及相关设置都放入一个代码框当中

<?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"
    android:background="@drawable/dp1">


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_marginTop="70dp">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="地铁查询"
            android:textSize="40dp"
            android:textColor="@color/black"
            android:layout_gravity="center"
            />
        <Button
            android:id="@+id/btn_screach1"
            android:layout_width="300dp"
            android:layout_gravity="center"
            android:layout_height="50dp"
            android:layout_marginTop="70dp"
            android:padding="10dp"
            android:background="@drawable/but_on"
            android:text="线    路    查    询"/>
        <Button
            android:id="@+id/btn_screach2"
            android:layout_width="300dp"
            android:layout_gravity="center"
            android:layout_height="50dp"
            android:layout_marginTop="70dp"
            android:padding="10dp"
            android:background="@drawable/but_on"
            android:text="站    点    查    询"/>
        <Button
            android:id="@+id/btn_screach3"
            android:layout_width="300dp"
            android:layout_gravity="center"
            android:layout_height="50dp"
            android:layout_marginTop="70dp"
            android:padding="10dp"
            android:background="@drawable/but_on"
            android:text="始    末    查    询"/>
    </LinearLayout>
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="50dp"
        android:text="欢迎使用地铁查询app"
        android:textColor="@color/white"
        android:textSize="30dp"/>
</RelativeLayout>

<?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"
    android:background="@drawable/dp2">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_marginTop="70dp">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="线路查询"
            android:textSize="40dp"
            android:textColor="@color/black"
            android:layout_gravity="center"
            />
          <EditText
              android:layout_marginTop="40dp"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:hint="线路查询"
              />
        <Button
            android:id="@+id/btn_choice1"
            android:layout_width="300dp"
            android:layout_gravity="center"
            android:layout_height="50dp"
            android:layout_marginTop="20dp"
            android:padding="10dp"
            android:background="@drawable/but_on"
            android:text="查            询"/>
    </LinearLayout>


</RelativeLayout>



<?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"
    android:background="@drawable/dp3">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_marginTop="70dp">
        <TextView
            android:layout_marginTop="55dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="站点查询"
            android:textSize="40dp"
            android:textColor="@color/black"
            android:layout_gravity="center"
            />
        <EditText
            android:layout_marginTop="40dp"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:hint="线路查询"
            />
        <Button
            android:id="@+id/btn_choice2"
            android:layout_width="300dp"
            android:layout_gravity="center"
            android:layout_height="50dp"
            android:layout_marginTop="20dp"
            android:padding="10dp"
            android:background="@drawable/but_on"
            android:text="查            询"/>
    </LinearLayout>


</RelativeLayout>



<?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"
    android:background="@drawable/dp4">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_marginTop="70dp">
        <TextView
            android:layout_marginTop="30dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="始末查询"
            android:textSize="40dp"
            android:textColor="@color/black"
            android:layout_gravity="center"
            />
        <EditText
            android:layout_marginTop="30dp"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:hint="起始站"
            />
        <EditText
            android:layout_marginTop="30dp"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:hint="终点站"
            />
        <Button
            android:id="@+id/btn_choice3"
            android:layout_width="300dp"
            android:layout_gravity="center"
            android:layout_height="50dp"
            android:layout_marginTop="20dp"
            android:padding="10dp"
            android:background="@drawable/but_on"
            android:text="查            询"/>
    </LinearLayout>


</RelativeLayout>




<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="#6666ff"/>
    <corners android:radius="105dip" />
    <stroke android:width="3dp" android:color="@color/white" />
</shape>
View Code

工作照: