For example, the components added to the ScrollView cannot be automatically scaled to the screen height in any way.
Layout file.
[Html]
<? Xml version = "1.0" encoding = "UTF-8"?>
<! -- Background: blue -->
<ScrollView xmlns: android = "http://schemas.android.com/apk/res/android"
Android: id = "@ + id/scrollView1"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent"
Android: background = "# 0000ff">
<! -- Background: Green -->
<LinearLayout
Android: id = "@ + id/linearLayout1"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent"
Android: background = "#00ff00">
<TextView
Android: id = "@ + id/textView1"
Android: layout_width = "wrap_content"
Android: layout_height = "fill_parent"
Android: layout_weight = "1"
Android: text = "Hello Android.">
</TextView>
</LinearLayout>
</ScrollView>
.
Although android: layout_height = "fill_parent" has been set, the entire LinearLayout and TextView cannot be filled with the entire screen.
Solution.
Add an android: fillViewport = "true" attribute to ScrollView. As the name suggests, this attribute allows components in ScrollView to fill it.
Modified.
Author: manoel