Skip to content

Instantly share code, notes, and snippets.

Created January 13, 2011 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/778054 to your computer and use it in GitHub Desktop.
Save anonymous/778054 to your computer and use it in GitHub Desktop.
A ScrollableView inside a View inside a TableRowView causes duplication of data
var winMain = Titanium.UI.createWindow({
title:'',
fullscreen:true,
navBarHidden:true,
exitOnClose: true});
var tableData = [];
for (var c=0;c<20;c++)
{
var thisLabelTitle = Ti.UI.createLabel({
color: 'white',
text: c,
top: 5,
left: 20
});
var thisLabelDesc = Ti.UI.createLabel({
color: 'white',
text: 'description...',
top: 25,
left: 10
});
var thisRow = Ti.UI.createTableViewRow({
className: "jobdata",
layout: "vertical",
objectName: "jobRow",
selectedColor: "black",
height: 35
});
var view1 = Titanium.UI.createView();
view1.add(thisLabelTitle);
var view2 = Titanium.UI.createView({backgroundColor:'#456'});
view2.add(thisLabelDesc);
var scrollView = Titanium.UI.createScrollableView({
views:[view1,view2]
});
var parentView = Titanium.UI.createView();
parentView.add(scrollView);
thisRow.add(parentView);
tableData.push(thisRow);
}
var tableview = Titanium.UI.createTableView({
data: tableData,
top:20
});
winMain.add(tableview);
winMain.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment