2010-03-11 83 views

回答

1

我將有一個去:

android:scrollbars="horizontal" 
在視圖中的你的XML定義

,但是如果你使用的是滾動視圖,它不支持水平滾動,所以酒吧將不會顯示...

+0

不以這種方式工作... – Amit 2010-03-11 12:40:49

+0

正如我所說,如果你使用的是滾動型它將無法工作因爲它不被支持。看看Android文檔,你會發現只有垂直滾動是在方法中定義的: http://developer.android.com/intl/fr/reference/android/widget/ScrollView.html 所以你必須改變你的View例如 – Sephy 2010-03-11 13:23:29

1

把屬性放在滾動視圖標籤。

android:scrollbars="horizontal" 
+0

我認爲scrollview不支持水平滾動條,請參閱http://groups.google.com/group/android-developers/browse_thread/thread/d675b7ed8ea72091 – Sephy 2010-03-11 10:45:26

+0

如果您需要訪問這兩個滾動條使用管道( |)之間。 android:scrollbars =「horizo​​ntal | vertical」 – Praveen 2010-03-11 12:31:37

+0

管道方法似乎沒有工作... – Amit 2010-03-11 12:35:22

6

加入看一看這一點,它可以是U想要什麼。

<ScrollView 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 

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

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

        <TableRow 
         android:layout_width="fill_parent" 
         android:layout_height="fill_parent"> 
         <ImageView android:src="@drawable/icon"/> 
         <ImageView android:src="@drawable/tube"/> 
        </TableRow> 

        <TableRow .... 
        </TableRow> 

        <TableRow .... 
        </TableRow> 

       </TableLayout> 

     </HorizontalScrollView> 

    </ScrollView>