Android Question .

Cableguy

Expert
Licensed User
Longtime User
the scrolview has a inner panel, thats the place to put stuff...see the help for the scrolview's panel methods
 
Upvote 0

raphael75

Active Member
Licensed User
Longtime User
Here is a simple example based on http://www.b4x.com/forum/basic4android-getting-started-tutorials/7221-list-two-columns-checkbox.html, but with shorter code:

B4X:
Sub Process_Globals
End Sub

Sub Globals
    Dim ScrollView1 As ScrollView
    Dim height As Int
    height = 50dip  ' <= Height of each line in the scroll view
End Sub

Sub Activity_Create(FirstTime As Boolean)
    ScrollView1.Initialize(0)
    Dim pnl As Panel
    pnl = ScrollView1.Panel
    Activity.AddView(ScrollView1, 0, 0, 100%x, 100%y)
    
    For i = 1 To 10
        Dim lbl1 As Label
        lbl1.Initialize("")
        lbl1.Text = "Line number " & i  ' <= Here you can write what you actually want to see on the screen
        pnl.AddView(lbl1, 0, height * (i - 1), 100%x, height)  ' <= Position and size of the label on the panel
    Next
    pnl.Height = 10 * height
End Sub

On the line "lbl1.Text = ..." you write what you want to see on the screen of your Android mobile.
 
Upvote 0

Merlot2309

Active Member
Licensed User
Longtime User
Hello Wheretheidivides,

Some B4A coders might be engineers but I certainly am not (anymore, ha, ha) and I do get what I want/need with help from Klaus and others.
Have a good look at the examples, use the code example of the one that looks best for your wishes and go through the code to see how it's built.
If you get stuck at one point there are so many people that will help you.
A Dutch expression: you catch more flies with honey than with vinegar :sign0089:

Success and post your progress.
Helen.
 
Upvote 0
Top