【发布时间】:2013-06-18 16:06:20
【问题描述】:
我在水平滚动条中有一个垂直滚动条。 仅当我一直水平滚动到右侧时,垂直滚动条才可见。但我希望它始终可见。
我该怎么做?有什么帮助吗?提前谢谢
我的 xml 看起来像这样
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/gridTitle"
android:layout_marginLeft="30dp"
android:layout_marginRight="18dp"
android:layout_marginBottom="5dp"
android:fadeScrollbars="false" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginBottom="13dp">
<!-- This Table Layout is header followed by the table itself-->
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:stretchColumns="*" >
<TableRow
android:id="@+id/tableHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TableRow>
</TableLayout>
<ScrollView
android:id="@+id/verticalScroll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fadeScrollbars="false">
<TableLayout
android:id="@+id/layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="12dp"
android:stretchColumns="*" >
</TableLayout>
</ScrollView>
</LinearLayout>
</HorizontalScrollView>
已编辑:
问题是,垂直滚动条在屏幕之外(如果我有很多表格列),所以我只能在水平滚动时看到它。但我希望它始终可见。
【问题讨论】:
-
你想要滚动条在scrollview还是horizontalscrollview?