Label text cannot be set unless initialized first...
Just noticed this earlier today..
if I have a label, with no 'text' attribute.. I am unable to later update that attribute..
label.text = 'blah' will do nothing.. no error. .or anything…
but if I at least have createLabel({text:''})
then label.text = 'blah' will work as expected..
just an fyi.. I'm using the continuous builds..
2 Answers
-
Accepted Answer
Critter
I have tested your observation on android continuous builds 1.4.X and 1.5.X using the following code, and they don't exhibit the issue.
var win1 = Ti.UI.createWindow({ backgroundColor:'white', navBarHidden:false, title:'This is window 1' }); var view1 = Ti.UI.createView({ backgroundColor:'blue', width:180 }); var label = Ti.UI.createLabel({ backgroundColor:'red' }); view1.add(label); win1.add(view1); win1.open(); label.text = 'this is my label';
Would you try this code on your system, to see if there really is a bug?
Which mobile platform are you using?
If you think it's an issue with your code, you could post it and I'm sure someone could help.
Cheers
-
Yeah.. not sure what the deal is.. your code works. so it's not a bug..
My code works if I set the text to '' when I create the labels.. shrug
for now it works. I'll jump more into it later..
thanks for the reply..