[TIMOB-15373] iOS: Setting "textid" on a Label after creation does not work
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Low |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | Release 3.1.2, Release 3.1.3 |
| Fix Version/s | n/a |
| Components | iOS |
| Labels | labe, textid |
| Reporter | Mostafizur Rahman |
| Assignee | Unknown |
| Created | 2013-09-30T02:21:18.000+0000 |
| Updated | 2018-10-03T11:08:02.000+0000 |
Description
Impossible to set textid property after creation label.
var win = Ti.UI.createWindow();
var lab = Ti.UI.createLabel({
color: "red",
text: "text: Hello"
});
//lab.text = L("hello"); // WORKS
lab.textid = "hello"; // DOESN'T WORK
win.add(lab);
win.open();
Issue reproduces Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.3.0.GA iOS SDK: 7.1 Building for iOS iPhone Simulator: 7.1
This issue causes another problem - It is not possible to set up textid for a label in ListItemTemplate. Example:
Especially annoying in Alloy View when instead of textid="xxx" must be used text="L(xxx)".var win = Ti.UI.createWindow({backgroundColor: 'white'}); var myTemplate = { childTemplates: [ { type: 'Ti.UI.Label', bindId: 'info', properties: { color: 'black', font: { fontFamily:'Arial', fontSize: '20dp', fontWeight:'bold' } } } ] }; var listView = Ti.UI.createListView({ templates: { 'template': myTemplate }, defaultItemTemplate: 'template' }); var sections = []; var fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits / Frutas'}); var fruitDataSet = [ { info: {text: 'Apple'}}, // No problem { info: {textid: 'apple'}} // Will not show any title ]; fruitSection.setItems(fruitDataSet); sections.push(fruitSection); listView.setSections(sections); win.add(listView); win.open();