ScrollViewを見てください。Web サイトのようなスクロール動作が可能になり、レイアウトを物理的な画面サイズよりも「大きく」することができます。
注意すべき点が 1 つあります。AScrollView
には、直接の子を 1 つだけ含めることができます。したがって、レイアウトにやViews
などの複数のが含まれている場合は、それらすべてをorでラップする必要があります。TextViews
Buttons
LinearLayout
RelativeLayout
たくさんの子を持つレイアウト:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout id="@+id/wrapper_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView />
<EditText />
<Button />
</LinearLayout>
</ScrollView
子が 1 つしかない場合は、「ラッパー」レイアウトは必要ありません。
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView id="@+id/lots_of_text_that_need_scrolling" />
</ScrollView>