滚动视图有两种,一种是ScrollView,另一种是HorizontalScrollView.
下面是activity_main.xml布局文件管理器<?xml version="1.0" encoding="utf-8"?>
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:textSize="50sp"
android:text="@string/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
请注意:ScrollView里只能有一个子控件,如果有多个就会报错!!
如果将我们将上面代码中的TextView再复制一份,如下:&