Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10088] Android: TextId wouldn't show up if the Color of label is set before textId

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-02-21T14:20:58.000+0000
Affected Version/sRelease 2.0.2, Release 2.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsapi, exalture
ReporterAmuktha Akkinepally
AssigneeSunila
Created2012-07-23T12:17:11.000+0000
Updated2017-03-17T18:30:57.000+0000

Description

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.

Attachments

FileDateSize
labelTextId.zip2012-07-23T14:55:37.000+00002322426

Comments

  1. Amuktha Akkinepally 2012-07-25

    The Help Desk Ticket corresponding this JIRA link is : http://support-admin.appcelerator.com/display/APP-594529
  2. Sunila 2013-02-20

    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.
  3. Sunila 2013-02-20

    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
  4. Sunila 2013-02-21

    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.
  5. Lee Morris 2017-03-17

    Closing ticket as the issue cannot be reproduced.

JSON Source