2012年7月1日 星期日

將tabgroup移置下方

Titanium Studio裡的tabgroup預設是在上方

要如何將tabgroup移到下方(bottom)呢?

可以參考
http://www.titaniumtutorial.com/2012/03/titanium-android-bottom-tabgroup.html

大意是說先建立資料夾

platform/android/res/layout/

並建立titanium_tabgroup.xml的檔案

內容放置



<?xml version="1.0" encoding="utf-8"?>

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"

    android:id="@android:id/tabhost"

    android:layout_width="fill_parent"

    android:layout_height="fill_parent">



    <LinearLayout

        android:orientation="vertical"

        android:layout_width="fill_parent"

        android:layout_height="fill_parent"

        android:padding="0dp">



        <FrameLayout

            android:id="@android:id/tabcontent"

            android:layout_width="fill_parent"

            android:layout_height="wrap_content"

            android:padding="0dp"

            android:layout_weight="1"/>



        <TabWidget

            android:id="@android:id/tabs"

            android:layout_width="fill_parent"

            android:layout_height="wrap_content"

            android:layout_weight="0"/>



    </LinearLayout>



</TabHost>


這樣執行就能將tabgroup移到下方顯示囉