2011-06-01 46 views
0

我在我的應用程序中使用TabHost,我想增加選項卡窗口小部件和framelayout之間的條帶厚度。 設置選項卡窗口小部件和FrameLayout之間的分隔符高度

<TabHost android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:id="@android:id/tabhost"> 
<LinearLayout android:orientation="vertical" 
android:layout_width="fill_parent" android:layout_height="fill_parent"> 

<TabWidget android:id="@android:id/tabs" 
android:layout_height="wrap_content" android:layout_width="fill_parent"> 
</TabWidget> 
<FrameLayout android:id="@android:id/tabcontent" 
android:layout_height="wrap_content" android:layout_width="fill_parent"       android:background="#FF0000"> 
<LinearLayout android:orientation="vertical" android:layout_height="wrap_content" android:layout_width="wrap_content"> 
<TextView android:text="TravelApplication1" android:layout_height="70dip" android:layout_width="fill_parent"></TextView> 
<TextView android:text="TravelApplication2" android:layout_height="70dip"  android:layout_width="fill_parent"></TextView> 
<TextView android:text="TravelApplication3" android:layout_height="70dip" android:layout_width="fill_parent"></TextView> 
<TextView android:text="TravelApplication4" android:layout_height="70dip" android:layout_width="fill_parent"></TextView> 
</LinearLayout> 
</FrameLayout> 
</LinearLayout> 

請建議我來增大tabWidget和的FrameLayout之間的厚度。

問候 迪帕克·戈埃爾

回答

1

添加margin屬性到您的FrameLayout元素會增加標籤控件和FrameLayout裏之間的空間:

<TabWidget android:id="@android:id/tabs" 
android:layout_height="wrap_content" android:layout_width="fill_parent"> 
</TabWidget> 
<FrameLayout android:id="@android:id/tabcontent" android:layout_marginTop="10dip" 
android:layout_height="wrap_content" android:layout_width="fill_parent" android:background="#FF0000"> 


....... 

</FrameLayout> 
</LinearLayout> 

編輯:在標籤插件的線是默認的,你有一個佈局,使自定義選項卡控件如果你想定製它。

+0

thnx爲你的迴應,但它只是將我的frameLayout從tabwidget下移,但我的問題是如何增加tabwidget和framelayout之間的線條厚度 – 2011-06-02 08:11:19

+0

對不起,我誤解了這一點。 – xtr 2011-06-02 08:57:17

+0

沒問題的人,雅與這是一個平行的問題是,我可以改變使用std tabwidget該行的clor – 2011-06-02 12:14:30

0

您是否嘗試過採用了android:paddingTop/paddingBottom來對標籤控件或框架的佈局?

相關問題