请问我的Activity当中最下面的控件显示不全。如何能让界面垂直滚动?界面当中控件比较多,希望能够通过垂直滚动将最下面的控件显示出来,请问如何实现啊?

解决方案 »

  1.   

    最外层布局 是ScrollView 
      

  2.   

    楼上正解..包在布局的最外面<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:scrollbars="vertical">
    </ScrollView>
      

  3.   

    ScrollView也是一个Layout布局,可以让它内部的数据显示不下的时候出现滚动条,要注意的是不能在ScrollView中放多个组件,如果放了多个组件,会出现如下错误:ERROR/AndroidRuntime(271): Caused by: java.lang.IllegalStateException: ScrollView can host only one direct child (ScrollView只能包裹一个直接子元素)
    http://android.yaohuiji.com/archives/319
      

  4.   

    这里有个关于垂直滚动的方法汇总:android垂直自动滚动