iOS Question [SOLVED] B4XTable text alignment LEFT with left padding

WhiteWizard

Member
Licensed User
Hi, I'm using Erel's algoritm to set the left aligment of my B4XTable columns, however the text appears so close to the left that is uggly, the only padding that I can add is a space as a first character in my cell strings, but this maybe hinters the search speed. Is there's another way to add some padding to the left?

Thanks
Alejandro

1615239350016.png


B4X:
Private Sub AlineacionCelda(column As B4XTableColumn,alineacionVertical As String,alineacionHorizontal As String)
    
    For i = 1 To column.CellsLayouts.Size - 1        'starts at 1 due to header
        Dim pnl As B4XView = column.CellsLayouts.Get(i)
        pnl.GetView(0).SetTextAlignment(alineacionVertical,alineacionHorizontal)
        
    Next
End Sub
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
Sub B4XTable1_DataUpdated
    SetAlignment
End Sub

Private Sub SetAlignment
    Dim col1 As B4XTableColumn = B4XTable1.GetColumn("Name")
    For i = 1 To col1.CellsLayouts.Size - 1
        Dim p As B4XView = col1.CellsLayouts.Get(i)
        p.GetView(0).SetTextAlignment("CENTER", "LEFT")
        p.GetView(0).SetLayoutAnimated(0, 5dip, 0, p.Width - 10dip, p.Height)
    Next
End Sub
 
Upvote 0
Top