Android ApiDemos示例解析(8):App->Activity->Hello world

在Android簡明開發教程三:第一個應用Hello World 已經介紹瞭Hello world示例,這兩個Hello world 的Layout定義稍有不同:

<TextView xmlns:android=”http://schemas.android.com/apk/res/android”
android:id=”@+id/text”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:gravity=”center_vertical|center_horizontal”
android:text=”@string/hello_world”/>

ApiDemo 示例中的將Hello world 顯示的屏幕中間。gravity 類似於其它平臺上的alignment(對齊)。

 
作者:mapdigit
 

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *