Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2799] iPhone: Change label width on swipe

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-07-26T14:09:24.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
Reporteraarmenta
AssigneeNeeraj Gupta
Created2011-04-15T03:29:49.000+0000
Updated2012-07-26T20:40:21.000+0000

Description

I have a tableView that contains a label visible and a hidden button. When I swipe the row it should reduces the width of the label for the button to display. This works perfectly with SDK 1.4.3 but not with 1.5.1.
I attach source code that proves the above:

var tableView = Titanium.UI.createTableView();
var rows = [];
var row = Titanium.UI.createTableViewRow();

var label1 = Titanium.UI.createLabel({
    text:'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse adipiscing.',
    width:300,
    font:{fontSize:12,fontFamily:'Helvetica Neue'},
});
row.add(label1);

var b1 = Ti.UI.createButton({
    title:'button',
    height:30,
    width:90,
    right:10,
    visible: false
});
row.add(b1);

var swiped = '';
row.addEventListener('swipe', function (e) {swiped = e.direction;});
row.addEventListener('touchend', function (e) {
    if (swiped == 'left'){
        label1.width = 200;
        b1.show();
    }
});

rows.push(row);

tableView.setData(rows);
Titanium.UI.currentWindow.add(tableView);

Comments

  1. Stephen Tramer 2012-07-26

    Tested against SDK 2.2.0.014b86f, iPhone Sim 5.1. Cannot reproduce as described (button appears so assume it "works perfectly").

JSON Source