第一次结对作业(六)
今日完成安卓app端页面,以及跳转页面的设计,修改布局及其相关内容。
以下为相关截图
以下为相关代码,布局页面以及相关设置都放入一个代码框当中
1 <?xml version="1.0" encoding="utf-8"?> 2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 xmlns:app="http://schemas.android.com/apk/res-auto" 4 xmlns:tools="http://schemas.android.com/tools" 5 android:layout_width="match_parent" 6 android:layout_height="match_parent" 7 android:background="@drawable/dp1"> 8 9 10 <LinearLayout 11 android:layout_width="match_parent" 12 android:layout_height="wrap_content" 13 android:orientation="vertical" 14 android:layout_marginTop="70dp"> 15 <TextView 16 android:layout_width="wrap_content" 17 android:layout_height="wrap_content" 18 android:text="地铁查询" 19 android:textSize="40dp" 20 android:textColor="@color/black" 21 android:layout_gravity="center" 22 /> 23 <Button 24 android:id="@+id/btn_screach1" 25 android:layout_width="300dp" 26 android:layout_gravity="center" 27 android:layout_height="50dp" 28 android:layout_marginTop="70dp" 29 android:padding="10dp" 30 android:background="@drawable/but_on" 31 android:text="线 路 查 询"/> 32 <Button 33 android:id="@+id/btn_screach2" 34 android:layout_width="300dp" 35 android:layout_gravity="center" 36 android:layout_height="50dp" 37 android:layout_marginTop="70dp" 38 android:padding="10dp" 39 android:background="@drawable/but_on" 40 android:text="站 点 查 询"/> 41 <Button 42 android:id="@+id/btn_screach3" 43 android:layout_width="300dp" 44 android:layout_gravity="center" 45 android:layout_height="50dp" 46 android:layout_marginTop="70dp" 47 android:padding="10dp" 48 android:background="@drawable/but_on" 49 android:text="始 末 查 询"/> 50 </LinearLayout> 51 <TextView 52 android:layout_width="wrap_content" 53 android:layout_height="wrap_content" 54 android:layout_alignParentBottom="true" 55 android:layout_centerHorizontal="true" 56 android:layout_marginBottom="50dp" 57 android:text="欢迎使用地铁查询app" 58 android:textColor="@color/white" 59 android:textSize="30dp"/> 60 </RelativeLayout> 61 62 <?xml version="1.0" encoding="utf-8"?> 63 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 64 xmlns:app="http://schemas.android.com/apk/res-auto" 65 xmlns:tools="http://schemas.android.com/tools" 66 android:layout_width="match_parent" 67 android:layout_height="match_parent" 68 android:background="@drawable/dp2"> 69 70 <LinearLayout 71 android:layout_width="match_parent" 72 android:layout_height="wrap_content" 73 android:orientation="vertical" 74 android:layout_marginTop="70dp"> 75 <TextView 76 android:layout_width="wrap_content" 77 android:layout_height="wrap_content" 78 android:text="线路查询" 79 android:textSize="40dp" 80 android:textColor="@color/black" 81 android:layout_gravity="center" 82 /> 83 <EditText 84 android:layout_marginTop="40dp" 85 android:layout_width="match_parent" 86 android:layout_height="match_parent" 87 android:hint="线路查询" 88 /> 89 <Button 90 android:id="@+id/btn_choice1" 91 android:layout_width="300dp" 92 android:layout_gravity="center" 93 android:layout_height="50dp" 94 android:layout_marginTop="20dp" 95 android:padding="10dp" 96 android:background="@drawable/but_on" 97 android:text="查 询"/> 98 </LinearLayout> 99 100 101 </RelativeLayout> 102 103 104 105 <?xml version="1.0" encoding="utf-8"?> 106 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 107 xmlns:app="http://schemas.android.com/apk/res-auto" 108 xmlns:tools="http://schemas.android.com/tools" 109 android:layout_width="match_parent" 110 android:layout_height="match_parent" 111 android:background="@drawable/dp3"> 112 113 <LinearLayout 114 android:layout_width="match_parent" 115 android:layout_height="wrap_content" 116 android:orientation="vertical" 117 android:layout_marginTop="70dp"> 118 <TextView 119 android:layout_marginTop="55dp" 120 android:layout_width="wrap_content" 121 android:layout_height="wrap_content" 122 android:text="站点查询" 123 android:textSize="40dp" 124 android:textColor="@color/black" 125 android:layout_gravity="center" 126 /> 127 <EditText 128 android:layout_marginTop="40dp" 129 android:layout_width="match_parent" 130 android:layout_height="match_parent" 131 android:hint="线路查询" 132 /> 133 <Button 134 android:id="@+id/btn_choice2" 135 android:layout_width="300dp" 136 android:layout_gravity="center" 137 android:layout_height="50dp" 138 android:layout_marginTop="20dp" 139 android:padding="10dp" 140 android:background="@drawable/but_on" 141 android:text="查 询"/> 142 </LinearLayout> 143 144 145 </RelativeLayout> 146 147 148 149 <?xml version="1.0" encoding="utf-8"?> 150 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 151 xmlns:app="http://schemas.android.com/apk/res-auto" 152 xmlns:tools="http://schemas.android.com/tools" 153 android:layout_width="match_parent" 154 android:layout_height="match_parent" 155 android:background="@drawable/dp4"> 156 157 <LinearLayout 158 android:layout_width="match_parent" 159 android:layout_height="wrap_content" 160 android:orientation="vertical" 161 android:layout_marginTop="70dp"> 162 <TextView 163 android:layout_marginTop="30dp" 164 android:layout_width="wrap_content" 165 android:layout_height="wrap_content" 166 android:text="始末查询" 167 android:textSize="40dp" 168 android:textColor="@color/black" 169 android:layout_gravity="center" 170 /> 171 <EditText 172 android:layout_marginTop="30dp" 173 android:layout_width="match_parent" 174 android:layout_height="match_parent" 175 android:hint="起始站" 176 /> 177 <EditText 178 android:layout_marginTop="30dp" 179 android:layout_width="match_parent" 180 android:layout_height="match_parent" 181 android:hint="终点站" 182 /> 183 <Button 184 android:id="@+id/btn_choice3" 185 android:layout_width="300dp" 186 android:layout_gravity="center" 187 android:layout_height="50dp" 188 android:layout_marginTop="20dp" 189 android:padding="10dp" 190 android:background="@drawable/but_on" 191 android:text="查 询"/> 192 </LinearLayout> 193 194 195 </RelativeLayout> 196 197 198 199 200 <?xml version="1.0" encoding="utf-8"?> 201 <shape xmlns:android="http://schemas.android.com/apk/res/android" 202 android:shape="rectangle"> 203 <solid android:color="#6666ff"/> 204 <corners android:radius="105dip" /> 205 <stroke android:width="3dp" android:color="@color/white" /> 206 </shape>
工作照:
<?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>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统