Android Question Read / Write Excel files on Android

fabio55

Member
Licensed User
See "similar threads" above this post :)
Ok, thanks very much for the suggestion. Looking on the links I found the table has a AddToActivity method where I can set the inner panel position.
For example: table1.AddToActivity(Activity, 0, 20%y, 100%x, 75%y)
 

KMatle

Expert
Licensed User
There is a sub you can call (you can find it in the "Table" module:

B4X:
Public Sub SetColumnsWidths(Widths() As Int)
    Dim v As View
    For i = 0 To Widths.Length - 1
        v = Header.GetView(i)
        v.Width = Widths(i) - 1dip
        If i > 0 Then
            v.Left = Header.GetView(i-1).Left + Widths(i-1) + 1dip
        End If
    Next
    Dim lbls() As Label
    For i = 0 To visibleRows.Size - 1
        lbls = visibleRows.GetValueAt(i)
        For lbl = 0 To lbls.Length - 1
            lbls(lbl).SetLayout(Header.GetView(lbl).Left, lbls(lbl).Top, _
                Header.GetView(lbl).Width, RowHeight)
        Next
    Next
End Sub
You can set the culumn width's by calling it with an array.

B4X:
Table1.SetColumnsWidths(Array As Int(100dip, 30dip, 30dip, 100%x - 160dip)
In the module you can modify the code to set anything you want (almost)
 
Top