Scrollview of Android Control

Source: Internet
Author: User

Android scrollview is a scroll list control.

KeyCodeAs follows:

XML code of the configuration file:

 
<? XML version = "1.0" encoding = "UTF-8"?> <Scrollviewandroid: Id = "@ + ID/myscroll" xmlns: Android = "http://schemas.android.com/apk/res/android" Android: layout_width = "fill_parent" Android: layout_height = "fill_parent"> <linearlayout Android: id = "@ + ID/mylinear" xmlns: Android = "http://schemas.android.com/apk/res/android" Android: Orientation = "vertical" Android: layout_width = "fill_parent" Android: layout_height = "fill_parent"> </linearlayout> </scrollview>

Activity key code:

Private string data [] = {"Shanghai zhongrui", "zhongrui holdings", "zhongrui education", "huafang teaching aids", "yuance", "Jiangsu tenggrui Information Technology ", "Jiangsu branch", "Rugao base", "Tangshan base", "agile technology", "zhongrui International Education", "huaqi Education"}; // defines an array, storage display information @ overridepublic void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); super. setcontentview (R. layout. main); // call the default layout manager linearlayout layout = (linearlayout) findviewbyid (R. id. mylinear); // obtain the component for (INT I = 0; I <this. data. length; I ++) {// cyclically encapsulate the above information through the button component. settext (this. data [I]); // set the display text layout. addview ();}}

Interface effect:

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.