dagodom Member Licensed User Longtime User Mar 2, 2017 #1 Hello maybe I'm missing out on a glass of water :-( I'm trying to create a label with autosizelabel without using designer and upload a layout. I tried Code: Copy Dim cv1 As AutoTextSizeLabel Dim p1, p2 As Panel p1.Initialize ("p1") p2.AddView (p1,0dip, 100% y / 16,100% x, y 100%) cv1.Initialize (p1, "cv1") cv1.Text = "Hello World" but I get the error java.lang.RuntimeException: Object Should first be initialized (Label). on this row Code: Copy mLbl.Text = value Does anyone have an example from which I can take inspiration? Thanks
Hello maybe I'm missing out on a glass of water :-( I'm trying to create a label with autosizelabel without using designer and upload a layout. I tried Code: Copy Dim cv1 As AutoTextSizeLabel Dim p1, p2 As Panel p1.Initialize ("p1") p2.AddView (p1,0dip, 100% y / 16,100% x, y 100%) cv1.Initialize (p1, "cv1") cv1.Text = "Hello World" but I get the error java.lang.RuntimeException: Object Should first be initialized (Label). on this row Code: Copy mLbl.Text = value Does anyone have an example from which I can take inspiration? Thanks
Erel B4X founder Staff member Licensed User Longtime User Mar 2, 2017 #2 You need to add it with the designer. You can create a layout file with only the AutoTextSizeLabel and load it to create the view. Upvote 0
You need to add it with the designer. You can create a layout file with only the AutoTextSizeLabel and load it to create the view.
dagodom Member Licensed User Longtime User Mar 2, 2017 #3 Thank's, but how can resize AutoTextSizeLabel after load i need to resize the panel ? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Mar 2, 2017 #4 Why do you need to resize it? Can you load the layout after the final size is set? Upvote 0
dagodom Member Licensed User Longtime User Mar 2, 2017 #5 Content of label change and i need resize based on content... Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Mar 2, 2017 #6 I've uploaded a new version, it should fix this issue: https://www.b4x.com/android/forum/threads/custom-view-autotextsizelabel.30642/#post-177986 Upvote 0
I've uploaded a new version, it should fix this issue: https://www.b4x.com/android/forum/threads/custom-view-autotextsizelabel.30642/#post-177986
dagodom Member Licensed User Longtime User Mar 2, 2017 #7 thank you, now you have solved my problem. Yours sincerely Upvote 0