Android Question ScrollView

Stefano Di Chiano

Active Member
Licensed User
Hi,

I'm working with a scrollView for the first time. Just as an example, I'm trying to display some lines of text following the format "Line number: 1", "Line number 2", etc...
I put a scrollView in a layout also containing an ImageView on top, and a label in another layout, that I then load on the scrollView panel in the activity_start.

The problem is that these lines show, there are a few empty lines. I want my texts to start showing at the beginning of the scrollView.

These are the variables:

[CODE lang="b4x" title="Globals"] Private ImageView1 As ImageView
Private ScrollView1 As ScrollView
Private LabelText As Label

Dim txt As String[/CODE]

This is the code I wrote:

[CODE lang="b4x" title="Activity_Start"] Dim i As Int

Activity.LoadLayout("scrollLayout")
ScrollView1.Panel.LoadLayout("textLayout")

txt=""

For i=1 To 200
txt=txt&"Test number: "&i&CRLF
Next
LabelText.Text = txt[/CODE]

If there are some informations I didn't provide, let me know.
Thanks.
 
Simpler to use xCustomListView .. (based on Scrollview)


If you are running a recent B4A version in is an internal library (also requires included XUI lib)
 
Upvote 0
Back
Top