天天看点

LinearLayout 垂直滚动条

<?xml version="1.0" encoding="utf-8"?>    

<ScrollView    

    xmlns:android="http://schemas.android.com/apk/res/android"    

    android:layout_width="fill_parent"    

    android:layout_height="fill_parent"    

    android:scrollbars="vertical"    

    android:fadingEdge="vertical">    

    <LinearLayout    

        android:layout_width="fill_parent"    

        android:layout_height="fill_parent"    

        android:orientation="vertical"    

        >    

    </LinearLayout>    

</ScrollView>    

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

这时只需在外面嵌套一个ScrollView就可以了,直接贴代码吧

本文转自 netcorner 博客园博客,原文链接:http://www.cnblogs.com/netcorner/p/4664752.html   ,如需转载请自行联系原作者

http://www.cnblogs.com/netcorner/p/4664752.html

继续阅读