Hopefully I can explain this accurately. I am working to get the width of a label using the reflector library. If I use it on a label defined in the designer it comes back with the width but if I declare one programatically then it comes back with 0. I'm not sure if this is something I have yet to learn with java classes or just forgetting something else. :BangHead:
Working returns values:
Returns 0's:
The text is actually converted richtext and loading it into a scrollview passed to customdialog. I am so close and like the clean look from the customdialog to display an initial welcome message that I can add images and links but am struggling with the autoformatting on this. I read where this reflector is a problem with ICS but hoping for a resolution on that soon as well.
Thanks, Jim
Working returns values:
B4X:
Dim obj as Reflector
obj.Target=designerlabel
designerlabel.text = "Long text string here of several paragraphs..."
doevents
mywidth=obj.RunMethod("getWidth")
myheight=obj.RunMethod("getHeight")
doevents
Returns 0's:
B4X:
Dim obj as Reflector
Dim programlabel as label
programlabel.Initialize("programlabel")
obj.Target=programlabel
programlabel.text = "Long text string here of several paragraphs..."
doevents
mywidth=obj.RunMethod("getWidth")
myheight=obj.RunMethod("getHeight")
doevents
The text is actually converted richtext and loading it into a scrollview passed to customdialog. I am so close and like the clean look from the customdialog to display an initial welcome message that I can add images and links but am struggling with the autoformatting on this. I read where this reflector is a problem with ICS but hoping for a resolution on that soon as well.
Thanks, Jim