天天看點

Android ----------UI控件和布局

第三章 Android ----------UI控件和布局

實驗目的

在Android Studio上如何實作UI開發的控件和布局,開發的項目名稱是UIWIidgetTest,如何用編譯的代碼來實作簡單的控件和布局。

軟體

Android Studio

實驗步驟

1. TextView****在界面上顯示一段文本資訊

Android ----------UI控件和布局

2. Button在界面上顯示一個按鈕

Android ----------UI控件和布局

3**.EditText可編輯的文本,允許使用者在控件裡輸入和編輯**

Android ----------UI控件和布局

4**. ImageView在界面上顯示圖檔**

Android ----------UI控件和布局
  1. ProgressBar在界面上顯示一個進度條
Android ----------UI控件和布局

6**.AlertDialog在目前界面彈出一個對話框,不同于上面的,這個是在程式中寫的**

Android ----------UI控件和布局

7.ProgressDialog在目前界面彈出一個有進度條的對話框,也是在程式中完成

Android ----------UI控件和布局
  1. 程式轉換字元串
Android ----------UI控件和布局

9.最後綜合得出

Android ----------UI控件和布局

10.在虛拟機上運作的效果

Android ----------UI控件和布局

11**.在手機運作效果**

Android ----------UI控件和布局
  1. 線性布局垂直方向布局vertical
    Android ----------UI控件和布局

13.運作得效果

Android ----------UI控件和布局

14.horizontal垂直方向布局

Android ----------UI控件和布局
  1. 運作效果
Android ----------UI控件和布局

16.layout_width水準寬度布局

Android ----------UI控件和布局

17.運作效果

Android ----------UI控件和布局

18.ListView的簡單用法

Android ----------UI控件和布局

19.public class FruitAdapter

Android ----------UI控件和布局

20.fruit

Android ----------UI控件和布局

21.LinearLayout

Android ----------UI控件和布局

22.FruitAapter

Android ----------UI控件和布局

23.在MainActivity中編寫,初始化水果資料

Android ----------UI控件和布局
  1. 最後運作效果
Android ----------UI控件和布局