0

出於某種原因,我不能水平通過我的線性佈局滾動...滾動型的LinearLayout內不會擴展

我嘗試這個解決方案,它沒有工作:LinearLayout not expanding inside a ScrollView

有什麼否則我錯過了?

這裏是我的代碼:

<?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> 

謝謝!

回答

2

如果你想水平滾動你應該使用Horizo​​ntalScrollView而不是ScrollView

+0

哇。我完全錯過了那裏有一個水平滾動視圖...謝謝!它馬上就完成了。哈哈。 –

+0

哈哈它發生了! –