Android Question How to Modify the SearchTemplate.SearchField width and buttons

cdsincfl

Member
Licensed User
Longtime User
I am using the B4XSearchTemplate and B4XDialog.

How can I NOT show the "check" and "X" in the search field area?
How can I set the width of the search field. The search field doesn't resize to the width of the dialog after using Template.Resize(60%x, 75%y).
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
Private Sub Button1_Click
    ResizeSearchTemplate(search, 90%x, 75%y)
    Dim rs As Object = dialog.ShowTemplate(search, "", "", "Cancel")
    search.SearchField.lblClear.RemoveViewFromParent
    search.SearchField.lblV.RemoveViewFromParent
    Wait For (rs) Complete (Result As Int)
End Sub

Private Sub ResizeSearchTemplate(SearchTemplate As B4XSearchTemplate, Width As Int, Height As Int)
    SearchTemplate.Resize(Width, Height)
    Dim sf As B4XFloatTextField = SearchTemplate.SearchField
    sf.mBase.SetLayoutAnimated(0, 2dip, 2dip, Width - 4dip, 50dip)
    sf.Base_Resize(sf.mBase.Width, sf.mBase.Height)
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…