TableLayout滚动型立式和放大器;卧式 [英] TableLayout ScrollView Vertical & Horizontal
问题描述
我们如何能够建立滚动型
垂直和放大器;水平?我想下面的code,但没有奏效。
How we can setup ScrollView
vertically & horizontally? I tried the below code, but it didn't work.
<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>
下面是我所有的code: http://pastebin.com/ysRhLMyt
Here is all my code : http://pastebin.com/ysRhLMyt
当前画面:
我要始终显示滚动条。
推荐答案
尝试,
-
设置了android:scrollbarFadeDuration =0
Set the android:scrollbarFadeDuration="0"
OR
ScrollView1.setScrollbarFadingEnabled(假);
ScrollView1.setScrollbarFadingEnabled(false);
OR
安卓scrollbarFadeDuration =0和
安卓scrollbarAlwaysDrawVerticalTrack =真正的垂直
android:scrollbarAlwaysDrawVerticalTrack="true" for vertical
安卓scrollbarAlwaysDrawHorizontalTrack =真实水平
android:scrollbarAlwaysDrawHorizontalTrack="true" for horizontal
还有一件事,
记住,滚动型只能有一个孩子的控制,所以我们可以做一个容器(线性,相对的,表格布局)的滚动型的孩子,把所有的控件这个孩子进去。
Remember, the ScrollView can have only one child control, so we can make a container (Linear, relative, Table Layouts) the child of the ScrollView and put all the controls inside this child.
有关参考: http://android-pro.blogspot.com /2010/02/android-scrollview.html
这篇关于TableLayout滚动型立式和放大器;卧式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!