Android ApiDemos example resolution (188): Views-& gt; ScrollBars-& gt; 1

Source: Internet
Author: User

This example introduces the basic usage of ScrollView. ScrollView allows you to scroll the screen to display content greater than the screen. ScrollView is a subclass of FrameLayout. Therefore, only one sublayout is displayed in ScrollView, generally, LinearLayout with the vertical direction is used as the subview of ScrollView. ScrollView only supports vertical scrolling.

There are already many examples of ScrollView when introducing Layout:

Android ApiDemos example resolution (153): Views-> Layouts-> ScrollView-> 1. Short
Android ApiDemos example resolution (154): Views-> Layouts-> ScrollView-> 2. Long
Android ApiDemos example resolution (155): Views-> Layouts-> ScrollView-> 3. Internal Selection
[Html]
<ScrollView xmlns: android = "http://schemas.android.com/apk/res/android"
Android: layout_width = "match_parent"
Android: layout_height = "wrap_content">
 
<LinearLayout
Android: orientation = "vertical"
Android: layout_width = "match_parent"
Android: layout_height = "wrap_content">
 
<TextView
Android: layout_width = "match_parent"
Android: layout_height = "wrap_content"
Android: text = "@ string/scrollbar_shorttext"/>
 
...
 
<TextView
Android: layout_width = "match_parent"
Android: layout_height = "wrap_content"
Android: text = "@ string/scrollbar_shorttext"/>
</LinearLayout>
</ScrollView>

<ScrollView xmlns: android = "http://schemas.android.com/apk/res/android"
Android: layout_width = "match_parent"
Android: layout_height = "wrap_content">

<LinearLayout
Android: orientation = "vertical"
Android: layout_width = "match_parent"
Android: layout_height = "wrap_content">

<TextView
Android: layout_width = "match_parent"
Android: layout_height = "wrap_content"
Android: text = "@ string/scrollbar_shorttext"/>

...

<TextView
Android: layout_width = "match_parent"
Android: layout_height = "wrap_content"
Android: text = "@ string/scrollbar_shorttext"/>
</LinearLayout>
</ScrollView>

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.