简体   繁体   English

将Android ScrollView滚动到X轴和Y轴

[英]Scrolling Android ScrollView to X-axis and Y-axis

In my Android app I wanna use a ScrollView and it must be scrollable to both X-axis and Y-axis . 在我的Android应用程序中,我想使用ScrollView ,它必须可以滚动X轴和Y轴 Without using both ScrollView and HorizontalScrollView as I did cant I use one ScrollView and enable both scrolls. 不使用ScrollViewHorizo​​ntalScrollView,因为我无法使用一个ScrollView并启用两个滚动。 What I did is below. 我在下面做了什么。

<ScrollView
    android:id="@+id/srv1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/ll1" >

    <HorizontalScrollView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >

        <LinearLayout
            android:id="@+id/linearMain"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:animateLayoutChanges="true"
            android:orientation="vertical" >
        </LinearLayout>
    </HorizontalScrollView>
</ScrollView>

Is it possible to use just one scroll view and enable both scrolls. 是否可以只使用一个滚动视图并启用两个滚动。 Thank You!! 谢谢!!

AFAIK, No. ScrollView is for vertical scrolling, as is ListView. AFAIK,编号ScrollView用于垂直滚动,ListView也是如此。 HorizontalScrollView is only for horizontal scrolling. Horizo​​ntalScrollView仅用于水平滚动。 To implement both x and y axis scrolling, you must use both ScrollView and HorizontalScrollView as you have done. 要实现x和y轴滚动,必须同时使用ScrollView和Horizo​​ntalScrollView。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM