gpt4 book ai didi

android - 如何水平滚动 LinearLayout?

转载 作者:行者123 更新时间:2023-11-29 18:07:19 24 4
gpt4 key购买 nike

我有一个比屏幕还大的 LinearLayout。我想水平滚动它。我有下一个代码,但它不起作用。谁能帮帮我?

<HorizontalScrollView
android:id="@+id/horizontalScrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >

<LinearLayout
android:id="@+id/gm_movimientos"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:orientation="horizontal" >

</LinearLayout>
</HorizontalScrollView>

最佳答案

您的 Horizo​​ntalScrollView 宽度需要设置为 match_parent 或固定大小。现在 ScrollView 正在扩展到与 LinearLayout 相同的尺寸(即它的边界也离开了屏幕)。

关于android - 如何水平滚动 LinearLayout?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12729412/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com