This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1526 from Dynasty011/master
实验四报告
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# 实验四 | ||
## 一、实验目标 | ||
  1.根据选题要求设计界面布局及控件使用; | ||
  2.布局xml及界面控制操作代码提交并截图; | ||
  3.将应用运行结果截图。 | ||
|
||
## 二、实验内容 | ||
  1.使用其中一种布局方式,设计所选题目的界面; | ||
  2.通过控件ID获取界面对象,执行相关操作: | ||
  // XML | ||
  android:id="@+id/my_button" | ||
  // Java | ||
  findViewById(R.id.my_button); | ||
|
||
  3.实现界面控件的事件处理; | ||
  4.操作之后,切换到你的第二个界面。 | ||
|
||
## 三、实验步骤 | ||
  1.根据项目需求选择使用相对布局方式。 | ||
  2.在activity_select_room.xml文件中配置相对布局代码,根据规格发表自己的动态。 | ||
  代码示例: | ||
~~~ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:paddingLeft="16dp" | ||
android:paddingRight="16dp" | ||
android:orientation="vertical" | ||
> | ||
<EditText | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:hint="@string/select_day" /> | ||
<EditText | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:hint="@string/select_time" /> | ||
<EditText | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:hint="@string/classroomNo" /> | ||
<EditText | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1" | ||
android:gravity="top" | ||
android:hint="@string/message" /> | ||
<Button | ||
android:layout_width="100dp" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="right" | ||
android:text="@string/send" /> | ||
</LinearLayout> | ||
~~~ | ||
## 四、实验结果 | ||
![lab4](https://raw.githubusercontent.com/Dynasty011/android-labs-2020/master/students/net1814080903322/lab4.PNG) | ||
|
||
## 五、实验心得 | ||
  在本次实验界面设计编程,在实验过程中遇到了布局内大小超出边界、重叠等问题,在经过修改对应的配置信息解决了问题。 |