Android Question [Solved] Questions about SearchTemplate (XUI Views)


Well-Known Member
Licensed User
Longtime User
Is possible made the changes below by code?
1 - change the theme: dark to light
2 - change the width of the positive button in dialog to avoid breakline in the word "Confirm" ("Confirmar" in my language)
3 - using the check button in the edit search to accept and use the text of the edit and not the item of list.
4 - click in item move the text to edit seach (and using confirm button to accept)



B4X founder
Staff member
Licensed User
Longtime User
Light theme:
Dim TextColor As Int = 0xFF5B5B5B
search.SearchField.TextField.TextColor = TextColor
search.SearchField.NonFocusedHintColor = TextColor = 0xFFDFDFDF = Dialog.BackgroundColor
search.CustomListView1.DefaultTextBackgroundColor = xui.Color_White
search.CustomListView1.DefaultTextColor = TextColor
If search.SearchField.lblV.IsInitialized Then search.SearchField.lblV.TextColor = TextColor
If search.SearchField.lblClear.IsInitialized Then search.SearchField.lblClear.TextColor = TextColor
Dialog.BackgroundColor = xui.Color_White
Dialog.ButtonsColor = xui.Color_White
Dialog.BorderColor = xui.Color_Gray
Dialog.ButtonsTextColor = 0xFF007DC3

Button width:
Dim rs As ResumableSub = Dialog.ShowTemplate(search, "CONFIRMAR", "", "CANCELAR")
Dim okbtn As B4XView = Dialog.GetButton(xui.DialogResponse_Positive)
okbtn.Width = 120dip
okbtn.Left = okbtn.Left - 50dip
Wait For (rs) Complete (Result As Int)

3 / 4 - Not possible without modifying the code. This is different than the designed behavior.
Last edited:
Upvote 0


Well-Known Member
Licensed User
Longtime User

- The buttons cancel and confirm in the SearchField are missing (I think is because the white color).
How to change the colors of this buttons?

- How to change the HintText of the SearchField by code?
I tried this, but don't work:
SearchTemplate.SearchField.HintText = "Selected the item"
Upvote 0