Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11102] iOS: TableView - TableView created with index/indexes misaligns the text in a row.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2012-11-06T20:24:46.000+0000
Affected Version/sRelease 2.1.3
Fix Version/s2012 Sprint 23 API, 2012 Sprint 23
ComponentsiOS
Labelsapi, qe-ios090112
ReporterAnshu Mittal
AssigneeVishal Duggal
Created2012-09-25T09:36:47.000+0000
Updated2014-06-19T12:44:40.000+0000

Description

TableView created with index/indexes misalign the text in a row. This is not regression since the issue occurs in 2.1.1 GA also. Steps to reproduce: 1. Create an app using the code below. 2. launch the app. Actual: The text in the first row is misaligned. The text is shifted to the right by 2 characters. Expected: The text should be properly aligned.

var _window=Ti.UI.createWindow({
    backgroundColor:'white'
});

var row1 = Ti.UI.createTableViewRow({
            // height:'auto',  
            height:Ti.UI.SIZE
         
        });
        var label1 = Ti.UI.createLabel({
            // height:'auto',
            top:0,
            height:Ti.UI.SIZE,
            text:'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'
        });
         
        row1.add(label1);
         
        var row2 = Ti.UI.createTableViewRow({
            // height:'auto',  
            height:Ti.UI.SIZE
        });
        var label2 = Ti.UI.createLabel({
            // height:'auto',  
            height:Ti.UI.SIZE,
            top:0,
            text:'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'
        });
         
        row2.add(label2);
         
         
        var table = Ti.UI.createTableView({
            index:[{index:0,title:'a'},{index:1,title:'b'}],
            data:[row1,row2]
        });
         
        _window.add(table);
        _window.open();

Comments

  1. Vishal Duggal 2012-11-06

    Labels have no horizontal pins so are centered horizontally in parent.
  2. Anshu Mittal 2013-05-10

    As per Vishal Duggal's comment, this behavior is due to the absence of horizontal pins. Thus, closing the issue.

JSON Source