2011-06-24 10 views
0

コンテンツを追加した後のスクロールではないが、私のレイアウトです:ScrollViewはここで動的に

私のコードでは
<LinearLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:orientation="vertical"> 
    <ScrollView 
      android:id="@+id/button_scroll" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_horizontal" 
      android:fillViewport="true"> 
     <LinearLayout 
       android:id="@+id/buttons" 
       android:orientation="horizontal" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:gravity="center_horizontal"/> 
    </ScrollView> 
</LinearLayout> 

、私は水平方向のLinearLayoutのID /ボタンにボタンを追加しています。私はそれらを十分に追加した後、すべてがうまくいく。それは決してスクロールしない。

私が試した:

  • コールの変更
  • ScrollViewにHorizo​​ntalScrollViewを使用してみてください

答えて

2

をwrap_contentするためのLinearLayoutためlayout_widthを無効に!私は数週間前に同じことを試してみたので、ScrollViewレイアウトは垂直方向にのみスクロールします!

+1

ああああ、そう簡単に...ありがとう! – Matthieu

関連する問題