B4A Library [custom view] AutoTextSizeLabel

Status
Not open for further replies.
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.

SS-2013-06-30_11.49.54.png


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 add a Custom View with the designer and set its type to this class.

The following libraries are required:
- JavaObject
- StringUtils
 

Attachments

  • AutoTextSizeLabel.zip
    8.5 KB · Views: 2,196
Last edited:

BarryW

Active Member
Licensed User
Longtime User
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.

SS-2013-06-30_11.49.54.png


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 add a Custom View with the designer and set its type to this class.

The following libraries are required:
- JavaObject
- StringUtils

How can i get this using Panel.getview(0)?
 

iCAB

Well-Known Member
Licensed User
Longtime User
Hi All

So far I have been doing all layouts by code, so this is my first time using the designer and Custom views.
I am just wondering why i am unable to capture the click event, even though the label is enabled in the designer.

B4X:
Private Sub AutoTextSizeLabel1_CLick
    Log("not trigerred by default ")
End Sub

For the above to work, I have to add the line below in DesignerCreateView
B4X:
lbl.Initialize("AutoTextSizeLabel1")

I am wondering if there is a better way perhaps using "Initialize"

Thanks
iCAB
 
Status
Not open for further replies.
Top