2011-06-24 197 views
0

这里后滚动是我的布局:滚动型不添加内容动态

<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 /按钮。一切都很顺利,只是在添加了足够的内容后,它从不滚动。

我想:

  • 呼叫了滚动
  • 更改为无效的LinearLayout中的layout_width尝试使用Horizo​​ntalScrollView为wrap_content

回答

2

! ScrollView布局只能垂直滚动,正如我几周前发现的那样尝试同样的事情!

+1

啊啊啊,这么简单...谢谢! – Matthieu