在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