Android Question Clear or reset a Scrollview

Marco Maria Vilucchi

Active Member
Licensed User
Longtime User
Hi all,
I have a scrollview into a panel.
Panel is in Designer, but scrollview is created by code.
This is the code:

scrollview add:
Dim hdricetta As ScrollView
Dim sostali As Label

...
...
Activity_Create
    hdricetta.Initialize(0)    ' initialize the ScrollView
    hdricetta.Panel.Color = pagecolor
    pgsostituzionePNsostituzioni.AddView(hdricetta,rleft, rtop, rwidth,rheight)
...
...
            For i = 1 To numitem
                    sostali.Initialize("sostali")
                    hdricetta.Panel.AddView(sostali, 5dip,wtop,rwidth,30dip)
                    sostali.TextSize=18
                    sostali.Typeface=Typeface.DEFAULT
                    sostali.TextColor=Colors.Black
                    sostali.Text=waliric(i)
            next
...
...
           hdricetta.Panel.Height = sostali.height * numitem

I need to clear scrollview to build different data
numitem can be different.
How can I do it?
Thanks in advance
Marcom
 

Star-Dust

Expert
Licensed User
Longtime User
Upvote 0

Marco Maria Vilucchi

Active Member
Licensed User
Longtime User
Switch to xCLV and everything will be simpler.
I can't in this moment switch to xCLV.

Seems I solved with this code:

Code:
    For i = hdricetta.Panel.NumberOfViews - 1 To 0 Step -1
        hdricetta.Panel.RemoveViewAt(i)
    Next
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I can't in this moment switch to xCLV.

Seems I solved with this code:

Code:
    For i = hdricetta.Panel.NumberOfViews - 1 To 0 Step -1
        hdricetta.Panel.RemoveViewAt(i)
    Next
B4X:
hdricetta.Panel.RemoveAllView
don't work?
 
Upvote 0
Top