2010-03-11 209 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>