Problem Description:
If we set the textId of a label before setting the color of the label, it works fine, but if we set the color first then text is never shown.
h4:Sample Code
var win = Ti.UI.createWindow({
backgroundColor: 'white',
layout: 'vertical'
});
var labelOne = Ti.UI.createLabel({
textid: 'myString',
color: 'black'
});
var labelTwo = Ti.UI.createLabel({
color: 'black'
//textid: 'myString',
});
labelTwo.textid = 'myString';
var labelThree = Ti.UI.createLabel({
color: 'black',
text: 'If you see THIS, i have not changed'
});
labelThree.textid = 'myString';
var labelFour = Ti.UI.createLabel({
color: 'black',
textid: 'dummytextid'
});
labelFour.textid = 'myString';
win.add(labelOne);
win.add(labelTwo);
win.add(labelThree);
win.add(labelFour);
win.open();
Strings.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="myString">YOU CAN SEE THIS STRING VALUE!!</string>
</resources>
1. label 1 shows up well because 'myString' textid is executed inside the main label method but two, three and four are not taken.
2. 'myString' is available in /i18n/en/strings.xml file.
3. Expected result: all the four strings should be shown.
The Help Desk Ticket corresponding this JIRA link is : http://support-admin.appcelerator.com/display/APP-594529
I am not able to reproduce the issue. I can see all the labels. I think the problem may be that the string is not picked up correctly because of some reason in the project setup.
I am not able to reproduce this, I can see all the four labels. It looks like an project environment setup issue, the strings may not be getting copied to the resource bundle
I am not able to reproduce this, all the labels shows up correctly. I think the strings are not defined properly and is not able to fetch it by id.
Closing ticket as the issue cannot be reproduced.