[TIMOB-11102] iOS: TableView - TableView created with index/indexes misaligns the text in a row.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-11-06T20:24:46.000+0000 |
Affected Version/s | Release 2.1.3 |
Fix Version/s | 2012 Sprint 23 API, 2012 Sprint 23 |
Components | iOS |
Labels | api, qe-ios090112 |
Reporter | Anshu Mittal |
Assignee | Vishal Duggal |
Created | 2012-09-25T09:36:47.000+0000 |
Updated | 2014-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();
Labels have no horizontal pins so are centered horizontally in parent.
As per Vishal Duggal's comment, this behavior is due to the absence of horizontal pins. Thus, closing the issue.