Android Question How to change the colour of the Search input Text in a B4XTable..

beelze69

Active Member
Licensed User
Longtime User
Hi,

I have a B4XTable in which I can set the Text Color(The color for displaying the output on the grid), the Highlight Text Color and the Selection color.

But the text I am inputting for the Search is always shown in Black.

Now I have a 'black' background due to which the text being inputted in the search is not visible although the filter(outcome of the Search input) is highlighted in the grid (since I can suitably change the color of the highlighted text)

My doubt: How to change the color of the inputted text in the Search area ...(I tried the changing the Text Color value to 'white' but it is still inputting in 'black')..

Requesting for guidance on the same.

Thanks
 

beelze69

Active Member
Licensed User
Longtime User
B4X:
B4XTable1.SearchField.TextField.TextColor=colors.white
Sorry Toby,

It is giving me the following error:

B4X:
java.lang.NullPointerException: Attempt to invoke virtual method 'void anywheresoftware.b4a.objects.B4XViewWrapper.setTextColor(int)' on a null object reference
 
Last edited:
Upvote 0

beelze69

Active Member
Licensed User
Longtime User
Add Sleep(0) after you load the layout. B4XTable loads another layout internally.
Thanks Erel, It worked !.. But can we be sure that this 'delay of 0 milliseconds' will work across all Android versions/mobile devices smoothly ?

Presently am testing on a Redmi Note 7 Pro with Android Version 9 PKQ1.181203.001..
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Thanks Erel, It worked !.. But can we be sure that this 'delay of 0 milliseconds' will work across all Android versions/mobile devices smoothly ?
I don't want to speak for Erel, but you will not have any trouble using it with B4XTable and in any version since it strated its use. The purpose of Sleep(0) after you load your main layout is simply to allow an internal layout in the B4XTable class to load itself, so you will not get the error you got earlier. If this is not satisfactory, wait for Erel's reassurance.
 
Upvote 0

beelze69

Active Member
Licensed User
Longtime User
Hi Mahares,

Thank you for your inputs.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…