http://android-doc.com/reference/android/widget/ScrollView.html
网址如下,ScrollView视图主要是给用户一个滚动的窗口,然后ScrollView里面只有一个LinearLayout的 布局,且只能有这一个,其余其他的内容只能在linearLayout里面添加。
再有就是可以直接在xml下的文件里给linearLayout添加元素,这样的话就导致所有的内容都是死的,已经固定了。同时也可以在linearLayout里面通过.addView来添加内容,以此来得到实时的更新。
其xml文件如下
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:android1="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${relativePackage}.${activityClass}" >
<ScrollView
android1:id="@+id/scrollView1"
android1:layout_width="wrap_content"
android1:layout_height="wrap_content"
android1:layout_alignParentLeft="true"
android1:layout_alignParentRight="true"
android1:layout_alignParentTop="true" >
<LinearLayout
android1:id="@+id/line"
android1:layout_width="match_parent"
android1:layout_height="wrap_content"
android1:orientation="vertical" &