2014年1月12日

LinearLayout

LinearLayout 線性位置版面配置

XML宣告

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello" />

</LinearLayout>



android:layout_gravity="center"
將LinearLayout中的元件置中對齊 


android:orientation
屬性值為"horizontal"(水平),所以元件的排版方式是以水平排版呈現



沒有留言:

張貼留言