android 滚动条

ScrollView简单应用

activity中经常只是一个LinearLayout,但这样的话,如果activity内容超过一屏,无法滚动查看下面的内容。

这时只需在外面嵌套一个ScrollView就可以了。

 1 <?xml version="1.0" encoding="utf-8"?>  
 2 <ScrollView  
 3     xmlns:android="http://schemas.android.com/apk/res/android"  
 4     android:layout_width="fill_parent"  
 5     android:layout_height="fill_parent"  
 6     android:scrollbars="vertical"  
 7     android:fadingEdge="vertical">  
 8     <LinearLayout  
 9         android:layout_width="fill_parent"  
10         android:layout_height="fill_parent"  
11         android:orientation="vertical"  
12         >  
13     </LinearLayout>  
14 </ScrollView>  
View Code
原文地址:https://www.cnblogs.com/UniqueColor/p/4872900.html