iOS Question [SOLVED] Scrollview doesn't work properly

Anton Solans Argemí

Active Member
Licensed User
Longtime User
Hi, all

I am attaching a test zip where the scrollview does not work correctly.
 

Attachments

  • pruebascrollview.zip
    3.4 KB · Views: 208

Anton Solans Argemí

Active Member
Licensed User
Longtime User
Thank you very much for the information Filippo, I will take it into account for future developments, but I would like to know what I am doing wrong as it is done.
 
Upvote 0
D

Deleted member 103

Guest
Thank you very much for the information Filippo, I will take it into account for future developments, but I would like to know what I am doing wrong as it is done.

You should always update the "ContentHeight".

B4X:
Sub AddRow(Values() As String)
    ' Adds a row to the table
    Dim ColWidth As Int
        
    If Values.Length <> NumberOfColumns Then
'        Log("Wrong number of values.")
        Return
    End If
    
    ColWidth=0
    For i = 0 To NumberOfColumns - 1
        Dim l As Label
        l.Initialize("cell")
        l.Text = Values(i)
        l.Font=Font.CreateNew(12)
        l.TextAlignment=l.ALIGNMENT_CENTER
        l.TextColor = FontColor(i)
        l.Color=CellColor(i)
        
        Dim rc As RowCol
        rc.Initialize
        rc.Col = i
        rc.Row = NumberOfRows
        l.Tag = rc
        Table.AddView(l, ColWidth, RowHeight * NumberOfRows, ColumnWidth_1(i), RowHeight_1)
        ColWidth=ColWidth+ColumnWidth(i)
        
    Next
    NumberOfRows=NumberOfRows+1
    Table.Height = NumberOfRows * RowHeight

    'add this line
    SVList.ContentHeight = Table.Height
        
End Sub
 
Upvote 0
Top