4

我的应用程序包含不同的布局。其中一个是线性布局。它的内容是动态添加的。我想让这个布局水平滚动。为此我把我的布局放在滚动视图中。但它仍然没有滚动......下面给出的是我的代码

 <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 回答