TableLayout ScrollView垂直和水平

Pir*_*aba 5 android scrollbar

我们如何ScrollView纵向和横向设置?我尝试了下面的代码,但它没有用.

<ScrollView
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="fill_parent"
 android:layout_height="wrap_content"
 android:background="@color/red"
 android:scrollbarFadeDuration="1000"
 android:scrollbarSize="12dip" >

   <HorizontalScrollView
     android:id="@+id/horizontalScrollView1"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content" >

      <TableLayout
        android:id="@+id/tableLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:collapseColumns="2"
        android:stretchColumns="1" >
    </TableLayout>
</HorizontalScrollView>

<ScrollView >
</ScrollView>
Run Code Online (Sandbox Code Playgroud)

这是我的所有代码:http://pastebin.com/ysRhLMyt

当前屏幕:

在此输入图像描述

我想总是显示滚动条.

K.K*_*nan 3

尝试,

还有一件事情,

请记住,ScrollView 只能有一个子控件,因此我们可以将一个容器(线性、相对、表布局)作为 ScrollView 的子控件,并将所有控件放入该子控件中。

供参考: http: //android-pro.blogspot.com/2010/02/android-scrollview.html