Android Question Button inside Edittext

Guenter Becker

Active Member
Licensed User
Good Day Experts,
in some Views like a combobox we can see a dropdown arrow aside an edittext. I know that I can create this by adding an edittext view and a label aside as childs of a panel. But I see also solutions like the ASActionEditText where a clickable text or character is placed inside the edit text. I think to do so is a more elegant way than using the panel solution.

I like to get an example (B4A) that shows how to place a clickable character inside the edit text like the hint text. I think it goes the way to use a Java function but I have no Idea about it. Does anyone have an answer?
 

toby

Well-Known Member
Licensed User
Longtime User
Use csbuilder. The following code is to make a label text clickable. Adapt to your need for hint text
B4X:
Dim cs As CSBuilder
   cs.Initialize.Size(30).Append("Some ").Append(CreateClickableWord("words"))
   cs.Append(" are ").Append(CreateClickableWord("clickable")).Append(".").PopAll
   Label1.Text = cs
   cs.EnableClickEvents(Label1)
 
Upvote 0

Guenter Becker

Active Member
Licensed User
Use csbuilder. The following code is to make a label text clickable. Adapt to your need for hint text
B4X:
Dim cs As CSBuilder
   cs.Initialize.Size(30).Append("Some ").Append(CreateClickableWord("words"))
   cs.Append(" are ").Append(CreateClickableWord("clickable")).Append(".").PopAll
   Label1.Text = cs
   cs.EnableClickEvents(Label1)
Hi,
this is what I tried. But if you use it in an Edittext.Hint the click event is not fired!
 
Upvote 0
Top