B4J Question B4XTable Set Header Color and Title Color

walterf25

Expert
Licensed User
Longtime User
I am using the B4XTable view, but I am having a hard time setting the Column Header's background color, I've tried the following:
B4X:
B4XTable1.HeaderColor = xui.Color_Cyan
But I do not see any change at all.

I have also tried the following solution posted by @Erel here https://www.b4x.com/android/forum/threads/b4xtable-header-gradient-color.123283/#post-770440 this works fine, however I do not like the idea of having to insert an invisible pane to accomplish this.

the solution I came up with is the following:
B4X:
        For Each v As B4XView In column.Panel.GetAllViewsRecursive
            If v Is Pane Then
                Dim p As Pane = v
                CSSUtils.SetBackgroundColor(p, fx.Colors.Cyan)
            End If
        Next
This works fine, but I feel like there should be an easier way of doing this, I mean, I get that this is a custom view but shouldn't there be a function included in the class to get this done?

Walter
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I get that this is a custom view
How is it relevant? The fact that it is a custom view means that it is more customizable than any other view.

1603177258479.png
 
Upvote 0
Top