ScrollView 内部的 LinearLayout 不会展开



由于某种原因,我无法水平滚动我的线性布局...

我尝试了这个解决方案,但它不起作用:线性布局无法在滚动视图中扩展

我还缺少什么吗?

这是我的代码:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fadingEdge="horizontal"
    android:scrollbars="horizontal"
    android:fillViewport="true" >
 <LinearLayout
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:orientation="horizontal"
     android:scrollbarStyle="insideOverlay"
     android:scrollbars="horizontal" >
     <ImageButton
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:background="@drawable/ventuscartoon" >
     </ImageButton>
     <ImageButton
         android:id="@+id/imageButton1"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:src="@drawable/eincartoon" />
     <ImageButton
         android:id="@+id/imageButton3"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:src="@drawable/ventuscartoon" />
     <ImageButton
         android:id="@+id/imageButton2"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:src="@drawable/ventuscartoon" />
</LinearLayout>
</ScrollView>

谢谢!

如果你想水平滚动,你应该使用水平滚动视图而不是滚动视图

最新更新