2011-12-09 44 views

回答

3

如果你不想要的東西不僅僅是滾動帶箭頭的標籤,你可以通過Horizo​​ntalScrollView的LinearLayout包住TabWidget更加複雜。

<?xml version="1.0" encoding="utf-8"?> 
<TabHost 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    params="..."> 
    <LinearLayout 
     android:orientation="vertical" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 
      <LinearLayout> 
       <ImageView 
        params="..."/> 
       <HorizontalScrollView 
        params="..."> 
         <TabWidget 
          params="..." /> 
       </HorizontalScrollView> 
       <ImageView 
        params="..."/> 
      </LinearLayout> 
     <FrameLayout 
      android:id="@android:id/tabcontent" 
      params="..." /> 
    </LinearLayout> 
</TabHost> 

而在代碼,你應該設置OnScrollListenerHorizo​​ntalScrollView消失箭頭

+0

它在horizo​​ntalscrollview –

+0

什麼錯誤的地方拋出的錯誤ImageView的?我在這裏寫這段代碼,所以我可以犯一些語法錯誤,但我在我的項目中完全是這樣的結構,它工作正常 – Jin35

+1

現在它工作正常。我想顯示用戶,因爲我在上圖中提到,當用戶按下需要移動的右側箭頭,在左側還需要顯示箭頭,當所有箭頭都在右側完成時,箭頭不需要顯示。 –