Android Question B4XTable - Reduce page navigation size and Font size and width of column header

Ronald Berardinis

Member
Licensed User
the page navigation and column header is taking up too much space.
What are the parameters to change size at top.
1660210986544.png


thank you in advance.
Ron
 

Mahares

Expert
Licensed User
Longtime User
You can change the header font and height using:
B4X:
B4XTable1.HeaderFont = xui.CreateDefaultBoldFont(20)
    B4XTable1.HeadersHeight =20dip
the above two lines must be placed before you assign the columns data which is:
B4X:
B4XTable1.AddColumn("Name", B4XTable1.COLUMN_TYPE_TEXT).Width=100dip
The above line showing the width allows you to change the width of the given column also.
 
Upvote 0

Ronald Berardinis

Member
Licensed User
You can change the header font and height using:
B4X:
B4XTable1.HeaderFont = xui.CreateDefaultBoldFont(20)
    B4XTable1.HeadersHeight =20dip
the above two lines must be placed before you assign the columns data which is:
B4X:
B4XTable1.AddColumn("Name", B4XTable1.COLUMN_TYPE_TEXT).Width=100dip
The above line showing the width allows you to change the width of the given column also.
thank you. Excellent !!!
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Is there a way to reduce size of the page navigator ?
You can try something like this. Note that I color coded the different panels involved to give you an idea of the multitude of labels. You can play around with the text sizes and heights. I am not sure: if there is a shorter code than the following:
B4X:
    Sleep(0)   'important line
    Dim pnlNav As Panel = B4XTable1.lblNumber.Parent
    pnlNav.Color=xui.Color_Magenta
    pnlNav.Height = 30dip
'    pnlNav.Top = -25dip
    For Each v As B4XView In pnlNav
        If v Is Label Then
            v.Height=30dip
            v.TextSize = 12
        End If
    Next

    B4XTable1.SearchField.mBase.Height=30dip
    B4XTable1.SearchField.mBase.Color=xui.Color_Cyan
    
    B4XTable1.lblFromTo.Color =xui.Color_Yellow
    B4XTable1.lblFromTo.TextColor= xui.Color_Red
    B4XTable1.lblFromTo.TextSize =12
    B4XTable1.lblFromTo.Top = B4XTable1.SearchField.mBase.top + B4XTable1.SearchField.mBase.Height
 
Upvote 1

Ronald Berardinis

Member
Licensed User
You can try something like this. Note that I color coded the different panels involved to give you an idea of the multitude of labels. You can play around with the text sizes and heights. I am not sure: if there is a shorter code than the following:
B4X:
    Sleep(0)   'important line
    Dim pnlNav As Panel = B4XTable1.lblNumber.Parent
    pnlNav.Color=xui.Color_Magenta
    pnlNav.Height = 30dip
'    pnlNav.Top = -25dip
    For Each v As B4XView In pnlNav
        If v Is Label Then
            v.Height=30dip
            v.TextSize = 12
        End If
    Next

    B4XTable1.SearchField.mBase.Height=30dip
    B4XTable1.SearchField.mBase.Color=xui.Color_Cyan
   
    B4XTable1.lblFromTo.Color =xui.Color_Yellow
    B4XTable1.lblFromTo.TextColor= xui.Color_Red
    B4XTable1.lblFromTo.TextSize =12
    B4XTable1.lblFromTo.Top = B4XTable1.SearchField.mBase.top + B4XTable1.SearchField.mBase.Height
Mahares, thank you very much.
I will try this out.
ron
 
Upvote 0
Top