4

さまざまなレイアウトを含む私のアプリケーション。そのうちの1つは線形レイアウトです。コンテンツは動的に追加されます。このレイアウトを水平方向にスクロール可能にしたいのです。このために、レイアウトをスクロールビューに配置しましたが、それでもスクロールしません。以下に私のコードを示します

 <LinearLayout android:id="@+id/scoreballparent_layout"
  android:layout_height="wrap_content"
  android:orientation="horizontal"
   android:layout_width="fill_parent"
  android:layout_above="@+id/score_layout">
  <ScrollView android:layout_height="wrap_content" 
  android:id="@+id/scrollView1" 
  android:layout_width="fill_parent" 
  >
      <LinearLayout android:layout_width="fill_parent" 
      android:id="@+id/scoreball_layout" 
      android:layout_height="wrap_content"
      android:isScrollContainer="true" 
      android:scrollbars="horizontal">

         </LinearLayout>
     </ScrollView>
</LinearLayout>
4

2 に答える 2

9

代わりにHorizo​​ntalScrollViewを使用してください

また、レイアウトがレイアウト領域に収まらない場合、レイアウトはスクロール可能になります。

于 2011-06-14T13:16:26.630 に答える
0

これをxmlで使用するだけ android:fadeScrollbars="true"でうまくいくかもしれません

于 2015-06-22T10:22:34.520 に答える