Put it inside a transparent panel.
Nope. Infact I know that even creating an empty sub will get the priority.. but actually I did not create any sub for the labelAre you handling the label's click event? If not then it shouldn't happen.
Private Panel1 As B4XView 'in globals
Private Label1 As Label
Private xui As XUI
Activity.LoadLayout("Layout1") 'in activity_create
Panel1.SetColorAndBorder(xui.color_transparent,4dip, xui.Color_Magenta,5dip)
Private Sub Panel1_Touch (Action As Int, X As Float, Y As Float)
Label1.Text="Mike1970"
End Sub
I will make a sample.I created a transparent panel with a label inside it as Erel instructed you and I was able to get the Panel touch event to fire:
B4X:Private Panel1 As B4XView 'in globals Private Label1 As Label Private xui As XUI Activity.LoadLayout("Layout1") 'in activity_create Panel1.SetColorAndBorder(xui.color_transparent,4dip, xui.Color_Magenta,5dip) Private Sub Panel1_Touch (Action As Int, X As Float, Y As Float) Label1.Text="Mike1970" End Sub
I will make a sample.
Are you handling the label's click event? If not then it shouldn't happen.
I created a transparent panel with a label inside it as Erel instructed you
You are so smart. How can we tell if it is yours or not. I wish others name them differently. I got so confused.This is not my AutoTextSizeLabel implementation.
mautopnl = xui.CreatePanel("mautopnl")
mautopnl = xui.CreatePanel("")
Thanks erel! actually i don't remember where i download that class, then i slighlty modified it to add maxTextSizeThis is not my AutoTextSizeLabel implementation.
It handles the Click event internally.
Set the event name to "":
B4X:mautopnl = xui.CreatePanel("")
I redid your project using the real AutoTextSizeLabel class written by Erel and it works effortlessly and flawlessly. It is so much better.i don't remember where i download that class
I think i used this: https://www.b4x.com/android/forum/threads/b4x-xui-autotextsizelabel.100187/#contentI redid your project using the real AutoTextSizeLabel class written by Erel and it works effortlessly and flawlessly. It is so much better.
This is the one from Erel. Highly recommend it. I have used before. I wish other developers give their libraries distinctive names different than what Erel uses. It is not fair to him. I spent over an hour this morning trying to solve your puzzle so I can help, thinking it was Erel's class module.:I think
I don't remember why i choosed, the other one, probably the original one gave me problem and i switched to the other.This is the one from Erel. Highly recommend it. I have used before. I wish other developers give their libraries distinctive names different than what Erel uses. It is not fair to him. I spent over an hour this morning trying to solve your puzzle so I can help, thinking it was Erel's class module.:
[custom view] AutoTextSizeLabel
When you set the text of this custom label the text size is automatically modified to the largest possible size so that all the text is visible. To use this view in your project, you should take the AutoTextSizeLabel class from the attached example and add it to your project. You should then...www.b4x.com
Thanks Erel and Mahares for your tips!Only B4A. The one you used can also work. It just does something with the click event internally so events are not passed through.