Problem description
The value of a label - which is inside a TableViewRow - is changed using a slider; however, the size of the label is not updated, and iOS shows the ellipsis if the text is larger.
Steps to reproduce
Use the following code:
var win = Titanium.UI.createWindow({
backgroundColor : 'white',
layout:'vertical'
});
slider1 = Ti.UI.createSlider({
top : 30,
value : 0,
min : 0,
max : 50000,
left : 0,
right : 0
});
slider1.addEventListener('touchend', function(e) {
slider1Change(e);
});
slider1.addEventListener('touchcancel', function(e) {
slider1Change(e);
});
function updatePerMonthLabel(_val) {
row.label.text = _val;
}
function slider1Change(e) {
updatePerMonthLabel(slider1.value);
}
var row = Titanium.UI.createTableViewRow();
var horizontalView = Ti.UI.createView({
layout : 'horizontal',
left : '5%',
right : '5%',
height : Ti.UI.SIZE
});
var amountLabel = Titanium.UI.createLabel({
left:0,
text:'$0',
top : 0,
width : Ti.UI.SIZE,
height : Ti.UI.SIZE
});
var yrLabel = Titanium.UI.createLabel({
width : Ti.UI.SIZE,
height : Ti.UI.SIZE,
text : "Year",
left : 10
});
horizontalView.add(amountLabel);
row.label = amountLabel;
horizontalView.add(yrLabel);
amountLabel = null;
yrLabel = null;
row.add(horizontalView);
var mainContentTableView = Titanium.UI.createTableView({
data : [row]
});
win.add(slider1);
win.add(mainContentTableView)
win.open();
In the beginning, everything looks ok. Moving the slider, though, will not update the size of the label, and ellipsis are shown. Moving the slide back to zero, or clicking the row solves the issue for the following changes.
Pull pending https://github.com/appcelerator/titanium_mobile/pull/3652
Backports 3_0_X https://github.com/appcelerator/titanium_mobile/pull/3677 2_1_X https://github.com/appcelerator/titanium_mobile/pull/3676
Verified in the following environment: Titanium SDK: 3.1.0.v20130105233407 Titanium SDK:3.0.1.v20130108154840 Titanium Studio:3.0.1.201212181159 Device: Simulator iOS 6.0