A demonstration of the ListView build in Basic4android

Source: Internet
Author: User

#Region Project Attributes #ApplicationLabel: listviewtest#versioncode:20140625#versionname: ' Supportedorientations Possible values:unspecified, landscape or Portrait. #SupportedOrientations: Unspecified#caninstalltoexternalstorage: False#end region#region Activity Attributes #FullScreen: false#includetitle:true#end regionsub process_globals ' These Global variables would be declared once when the application starts. ' These variables can is accessed from all modules. ' This project was modified in the Basic4android Development tutorial translation (eight) using the ListView "End SubSub Globals ' These Glob Al variables'll be redeclared each time the activity is created. ' These variables can only is accessed from the This module. Private Lvwbrowser as ListView ' declaration component End SubSub Activity_create (firsttime as Boolean) ' Do not forget to load the layout fil E created with the visual designer. For Example:Activity.LoadLayout ("1") Dim gd as gradientdrawable ' gradient effect class, gradientdrawable supports the use of gradients to draw a graphic GD. Initialize ("Top_bottom", Array as Int (Colors.black, Colors.lightgray)) ' firstParameters define the direction of the gradient, with the following values to select ' Top_bottom ' "top-down" ' "TR_BL" (Top-right to Bottom-left) (top-left) ' Right_left ' "right-to-left" Br_tl "(Bottom-right to Top-left)" Br_tl "(top left and right) ' bottom_top '" bottom-up "'" Bl_tr "(Bottom-left to Top-right)" Bl_tr "(top left and right) '" Left_right "" left-to-right "" Tl_br "(Top-left to Bottom-right) (top left-to-right) Activity.background = GD ' Activity window Body background using the gradient effect lvwbrowser.width =100%xlvwbrowser.scrollingbackgroundcolor = Colors.transparent ' vertical scrollbar background color = Transparent Lvwbrowser.initialize ("Lvwbrowser") LvwBrowser.SingleLineLayout.Label.TextSize = 20 ' Font size LvwBrowser.SingleLineLayout.Label.TextColor = Colors.green ' font Color lvwBrowser.SingleLineLayout.Label.Gravity = Gravity.left ' font display position lvwBrowser.SingleLineLayout.ItemHeight = 60dip ' Row height lvwBrowser.TwoLinesLayout.Label.TextSize =20 ' Font size LvwBrowser.TwoLinesLayout.Label.TextColor =colors.yellow ' Font Color lvwBrowser.TwoLinesLayout.SecondLabel.TextSize = 20 ' font size LvwBrowser.TwoLinesLayout.SecondLabel.TextColor = Colors.red ' Font Color lvwbrowser.fastscrollenableD = True ' Fast scroll ' Dim bitmapicon As Bitmapbitmapicon.initialize (file.dirassets, "1.png") Dim i as Int for I=1 to 20lvwBrowser . Addsingleline ("line item (addsingleline)" & i) Lvwbrowser.addtwolines ("Text double line item (addtwolines)" & I, "-Second row text--" & I ) Lvwbrowser.addtwolinesandbitmap ("Graph double line item" & I, "--second row text--" & I,bitmapicon) Nextactivity.addview (Lvwbrowser, 0, 0, 100%x, 100%y) End SubSub Activity_resumeend SubSub Activity_pause (userclosed as Boolean) End SubSub Lvwbrowser_itemcl  Ick (Position as Int, value as Object) ' parameter Position is the list item index ' parameter Value is the list item text Activity.title = "(" & Position & " ) "&"-"& ValueEnd Sub

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.