且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

机器人,水平和垂直滚动的网格布局

更新时间:2023-11-19 10:10:46

嗯,我找到了解决办法

这似乎是Android的滚动型可以作为一个VerticalScrollView且只有(名字不那么直观Horizo​​ntalScrollView)。

It seems like the android ScrollView works as a VerticalScrollView and only that (the name is not so intuitive as HorizontalScrollView).

因此​​,为了使一些滚动垂直和水平方向,你需要嵌套(垂直)滚动型内Horizo​​ntalScrollView,或其他方式,像这样

So to make something scrollable vertically and horizontally, you need to nest a (Vertical)ScrollView inside a HorizontalScrollView, or the other way around, like this

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <HorizontalScrollView
        android:layout_width="wrap_content"
        android:layout_height="match_parent">

            <!-- Your content here -->

     </HorizontalScrollView>
</ScrollView>