2010-10-04 82 views
4

我在選項卡視圖中使用了六個選項卡。在縱向模式下,標籤尺寸變得非常小。因此,我想要在水平方向上滾動標籤,以便每個標籤的尺寸保持原始。我們如何做到這一點?如何滾動tabview中的選項卡

+0

滾動選項卡http://kyogs.blogspot.in/2013/01/tab-with-scroll.html – kyogs 2013-01-09 07:13:21

回答

3

網絡上有很多解決方案,但它們都很複雜且不必要。如果你想讓屏幕頂部的標籤能夠滾動,那麼你可以使用下面顯示的這個簡單的實現。希望這可以幫助。

<HorizontalScrollView android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:fillViewport="true" 
    android:scrollbars="none"> 

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

</HorizontalScrollView> 
相關問題