[AC-2257] iOS: Adding a TextArea to a TableViewRow in a Table that exceeds the height of the display causes labels to disappear randomly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2013-04-05T09:23:11.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | disappear, ios, label, random, tableview, textarea |
Reporter | Moritz Roessler |
Assignee | Mauro Parra-Miranda |
Created | 2012-11-26T14:21:06.000+0000 |
Updated | 2016-03-08T07:41:15.000+0000 |
Description
(sorry if i don't get the formating here, i yet have to got how this works =
I tested this on iOS only,
I noticed some randomly disappearing labels on my Project,
it seemed only to happen if following conditions where given:
Table Style set to Grouped
A textarea has to be added to the table
a row has to be deleted or inserted
the label has to be scrolled out of the visible area
the table has to exceed the height of the display
---- However when i tried to reproduce the problem, Some labels just disappear randomly when i add an view , with an textarea, to a row , in a table that is longer than the display ??When i was playing around, trying to reproduce this, sometimes when deleting or inserting rows, labels disappeared randomly when scrolled out of the visible area, even without a textarea, but this only happend 1-2 out of 10 times when i run the build.?? But this is what i ended up with and every time i run it some labels just disappear randomly:
Titanium.UI.setBackgroundColor('#000');
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var table = Ti.UI.createTableView({
style: Titanium.UI.iPhone.TableViewStyle.GROUPED //Well this seemed to be one of the cause for the bug, however it happens without a grouped style as well
});
/*
* Just create some rows with labels on it
*/
var rows = ["A","As","Asd","ASDF","Bcda","Basd","Basd","Casdf","Casper","Deasd","Dets","Esdfg","Egsdf","Fsdf","Fasdf","Fsdf","Gasdf","Gsdf","Gasdf","Gsdf","Gasdf","Hsdf","Hasdf","Hsdf","Hasdf","Isdf","Iasdf","Isdf","Iasdf","Jsdf","Jasdf","Jsdf","Jasdf","Ksdf","Kasdf"];
var secarr = [];
for (var i = 0,currS,lastl,l; i < rows.length; i++) {
l = rows[i].substr(0,1);
if(l != lastl) {
currS = Ti.UI.createTableViewSection({
headerTitle:l
});
secarr.push(currS)
}
var view = Ti.UI.createView({
height:40
})
var label = Ti.UI.createLabel({
text:rows[i],
height:40,
textAlign:"right",
right:10
})
var row = Ti.UI.createTableViewRow({
height:40,
title:rows[i]
})
view.add(label)
row.add(view)
currS.add(row)
lastl = l;
}
/*
* Finished with the rows
*/
var textAreaRow = Ti.UI.createTableViewRow({
title:"",
height:150
})
var textAreaView = Ti.UI.createView({})
var textArea = Ti.UI.createTextArea({
width:"100%",
height:150
})
textAreaView.add(textArea)
textAreaRow.add(textAreaView)
/*The textarea in a tableview row seems to be the of the problem, comment it out and the labels should show correctly
*
*/
secarr[0].add(textAreaRow)
table.setData(secarr)
win1.add(table);
win1.open()
// for (var i = 1;i<10;i++) {
// table.deleteRow(10);
// }
/*
* Deleting some rows seemed to be the second one
* Well again, in this case it even screws up without deleting rows
*/
Can't reproduce it on my end; scrolling around and clicking for a while, nothing disappears. Tested on both 2.1.4 GA and latest 3.1 CI with iOS 6 simulator. If you can still reproduce it with 3.0.2 GA, can you attach a screenshot? Thanks!