2012-07-20 85 views
0

目前,我在Android平臺的TabBar應用。在這裏我提到了代碼供你參考,我參考了網頁,發現了一些鏈接(android:layout_alignParentBottom =「true」)在TabWidget中插入這一行,但Tabbar只在Top中可見,所以請幫助我如何設置的TabBar在Android的屏幕底部?

由於提前僅

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

<TabHost xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/tabhost" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#EBF1FF"> 

    <LinearLayout 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 

    <TabWidget android:id="@android:id/tabs" 
     android:layout_width="fill_parent" 
    =========> android:layout_alignParentBottom = "true" <======= 
     android:layout_height="wrap_content" 
    /> 

    <FrameLayout android:id="@android:id/tabcontent" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 
+0

[嘗試此一次](http://envyandroid.com/archives/326/align-tabhost-at-bottom)以及[在底部具有時尚TabHost](https://github.com/AdilSoomro/Iphone -Tab功能於Android設備) – Praveenkumar 2012-07-20 06:48:07

回答

1

android:layout_alignParentBottom = "true"作品如果TabWidget裏面有個RelativeLayout ..

<RelativeLayout 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 

<TabWidget android:id="@android:id/tabs" 
    android:layout_width="fill_parent" 
android:layout_alignParentBottom = "true" 
android:layout_height="wrap_content" /> 

<FrameLayout android:id="@android:id/tabcontent" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
</RelativeLayout> 
+0

感謝您的答覆 – SampathKumar 2012-07-20 06:48:29

+0

那麼,如何解決這個問題。做ü有任何想法 – SampathKumar 2012-07-20 06:48:56

+0

更新了我的答案:) – Nermeen 2012-07-20 06:49:53

0

只要把TabWidgetFrameLayout

並使用android:tabStripEnabled="false"隱藏tabwidget下條,因爲它看起來醜陋時,它的底部。

+0

感謝您的回覆 – SampathKumar 2012-07-20 08:04:15

相關問題