Junk is observed on TableView rows objects containing labels.
Attached are the screen shots of the issue. Attached two Screen shots for iOS 6 and iOS 7.
var win = Titanium.UI.createWindow({
backgroundColor : '#fff'
});
var table = Ti.UI.createTableView({
top : 0
});
var rows = [];
var noteDetailArr = [{
title : '\n Group Collaborated With: This is test group\nPerson Consulted With: This person is added for testing in this note\n******************************************************\nSummary - Latest synopsis of investigation\n******************************************************\nSummary for test\n******************************************************\nEvidence - Logs, outputs, errors\n******************************************************\nEvidence for test\n******************************************************\nTimetable - Action plan and ownership\n******************************************************\nTime table for test'
}, {
title : '\n******************************************************\nTimetable - Action plan and ownership\n******************************************************\nGhxg shut'
}, {
title : 'Test'
}, {
title : '\n******************************************************\nTimetable - Action plan and ownership\n******************************************************\nxcfb fcg s\nSetting Next Customer Contact Time to 08-30-2013 10:30:00 EST, if this is unacceptable please let me know.'
}, {
title : '\nContact Method: Email\nContact Name: Lsnsdj sfd\nNumber/Address Used: 2155 456465\n******************************************************\nTimetable - Action plan and ownership\n******************************************************\nsfglkns sdfigvasi dva va\nSetting Next Customer Contact Time to 08-30-2013 06:00:00 EST, if this is unacceptable please let me know.'
}, {
title : '******************************************************\nSummary - Latest synopsis of investigation\n******************************************************\nVvbuic if hug\n******************************************************\nEvidence - Logs, outputs, errors\n******************************************************\nICUs Yogyakarta fyggygovvyvyg\n******************************************************\nTimetable - Action plan and ownership\n******************************************************\nJvvtg thigh\nSetting Next Customer Contact Time to 09-03-2013 05:08:21 EST, if this is unacceptable please let me know.'
}, {
title : '\n******************************************************\nSummary - Latest synopsis of investigation\n******************************************************\ngfd\n ******************************************************\nTimetable - Action plan and ownership ******************************************************\ngjgkdfgdklgdfgjdljglk\nSetting Next Customer Contact Time to 09-04-2013 05:30:00 EST, if this is unacceptable please let me know.'
}];
var tableFooterView = Ti.UI.createView({
height : 20,
touchEnabled : false,
allowsSelection : false,
borderWidth : 0,
borderColor : 'transparent'
});
for (var i = 0; i < noteDetailArr.length; i++) {
var row = Ti.UI.createTableViewRow({
backgroundColor : "#FFF",
height : 96,
hasChild : true
});
var noteTypeLabel = Ti.UI.createLabel({
highlightedColor : '#FFF',
top : 22,
left : 10,
textAlign : "left",
height : 21,
font : {
fontSize : 14,
fontWeight : "bold"
},
color : '#000'
});
var noteDateLabel = Ti.UI.createLabel({
highlightedColor : '#FFF',
top : 3,
right : 0,
textAlign : "right",
height : 17,
minimumFontSize : 11,
font : {
fontSize : 13,
fontWeight : "bold"
},
color : '#2A4164'
});
var noteDetailLabel = Ti.UI.createLabel({
highlightedColor : '#FFF',
top : 43,
left : 10,
right : 5,
height : 32,
font : {
fontSize : 13,
fontWeight : "normal"
},
color : "#808080"
});
var userNameLabel = Ti.UI.createLabel({
highlightedColor : '#FFF',
top : 76,
left : 10,
height : 16,
textAlign : "left",
color : "#AAA",
font : {
fontSize : 12
}
});
var noteContextLabel = Ti.UI.createLabel({
highlightedColor : '#FFF',
top : 76,
right : 5,
height : 16,
textAlign : "right",
color : "#AAA",
font : {
fontSize : 12
}
});
var _noteType = 'Action Plan' + i;
var _noteDate = '23/08/2013';
noteTypeLabel.text = _noteType;
noteDateLabel.time = '12:15 PM';
noteDateLabel.text = _noteDate;
noteDetailLabel.text = noteDetailArr[i].title;
userNameLabel.text = 'Test User';
row.backgroundColor = '#DEE9F4';
userNameLabel.color = "#2A4164";
noteContextLabel.color = "#2A4164";
row.add(noteTypeLabel);
row.add(noteDateLabel);
row.add(noteDetailLabel);
row.add(userNameLabel);
var noteContext = "External Note";
noteContextLabel.text = noteContext;
row.add(noteContextLabel);
rows.push(row);
}
table.backgroundColor = 'transparent';
table.footerView = tableFooterView;
// Add all the notes to the table
table.setData(rows);
table.allowsSelection = true;
win.add(table);
win.open();
This is not our bug but an apple rendering issue on IOS7. For some reason apple does not like label texts to begin with a newline character. The junk data we are seeing is actually from the third line of the content. Adding a leading space to the text before the newline character seems to fix the issue. Try this
Closing per comments.