安卓开发之ScrollView

当界面不足以将所有的内容显示出来的时候便导致下面的部分内容无法显示出来

所有加上ScrollView 来讲要显示的内容放入之中便可以实现上下滚动界面内容

但是当要显示多个控件的时候会出错  原因是ScrollView只能有一个子控件  解决方法就是 用一个LinearLayout(或者别的布局)来嵌套所有的控件

xml代码如下:

                              <ScrollView 
		android:id="@+id/ScrollView"
		android:layout_width="fill_parent" 
		android:layout_height="wrap_content" 
		android:scrollbars="vertical"> 
		<LinearLayout
		    android:layout_width="match_parent"
		    android:layout_height="fill_parent"
		    android:orientation="vertical" >
		  -------------这里添加任意个控件----------		 
                                 </LinearLayout>
		
	                 </ScrollView>
原文地址:https://www.cnblogs.com/xqxacm/p/4260935.html