mud*_*dit 61 android android-widget android-scrollview
我正在使用TableLayout.我需要为此布局同时进行水平和垂直滚动.默认情况下,我可以在视图中进行垂直滚动,但水平滚动不起作用.
我使用的是Android SDK 1.5 r3.我已经尝试过了android:scrollbars="horizontal".
我在一些论坛上看到,在杯形蛋糕更新中,水平滚动是可能的.
如何让我的布局在两个方向上滚动?
mud*_*dit 134
我能够找到一种简单的方法来实现两种滚动行为.
这是它的xml:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:scrollbars="vertical">
<HorizontalScrollView
android:layout_width="320px" android:layout_height="fill_parent">
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linlay" android:layout_width="320px"
android:layout_height="fill_parent" android:stretchColumns="1"
android:background="#000000"/>
</HorizontalScrollView>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)
它为时已晚,但我希望您的问题能够通过此代码快速解决.没有什么可以做的只是把你的代码放在scrollview下面.
<HorizontalScrollView
android:id="@+id/scrollView"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
//xml code
</ScrollView>
</HorizontalScrollView>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
104902 次 |
| 最近记录: |