Android ApiDemos示例解析(188):Views->ScrollBars->1.Basic

来源:互联网 发布:淘宝网哪家男装好看 编辑:程序博客网 时间:2024/04/29 10:44

本例介绍了ScrollView 的基本用法,ScrollView 允许用户滚动屏幕以显示大于屏幕的内容,ScrollView 为FrameLayout的子类,因此一般只在ScrollView显示一个子Layout,通常使用方向为垂直方向的LinearLayout作为ScrollView的子View。 ScrollView只支持垂直滚动。

在介绍Layout时已经有不少关于ScrollView 的例子:

  • Android ApiDemos示例解析(153):Views->Layouts->ScrollView->1.Short
  • Android ApiDemos示例解析(154):Views->Layouts->ScrollView->2. Long
  • Android ApiDemos示例解析(155):Views->Layouts->ScrollView->3. Internal Selection
<ScrollView xmlns:android=”http://schemas.android.com/apk/res/android”android:layout_width=”match_parent”android:layout_height=”wrap_content”><LinearLayoutandroid:orientation=”vertical”android:layout_width=”match_parent”android:layout_height=”wrap_content”><TextViewandroid:layout_width=”match_parent”android:layout_height=”wrap_content”android:text=”@string/scrollbar_1_text”/>…<TextViewandroid:layout_width=”match_parent”android:layout_height=”wrap_content”android:text=”@string/scrollbar_1_text”/></LinearLayout></ScrollView>

 

原创粉丝点击