Created
January 13, 2011 15:37
-
-
Save anonymous/778054 to your computer and use it in GitHub Desktop.
A ScrollableView inside a View inside a TableRowView causes duplication of data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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