I want the rows to continue under the footer view "Tisdag 19 mars 2012"..
Screenshot: http://img403.imageshack.us/img403/4932/skrmavbild20120314kl084.png
3 Answers
To achieve the same as shown in your image, you can create sections each of your sections will have its own rows and then those sections will be added to your table. for more refrence on creating section: http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.TableViewSection-object
But it will be problem cuz of the Json-file I got?
var url = 'http://dl.dropbox.com/u/42299448/listacsam.json';
var table = Ti.UI.createTableView();
var createCustomView = function(title) { var view = Ti.UI.createView({ backgroundColor'#fff',
backgroundImage : 'tabelldatum.png',
height : 30 });
var text = Ti.UI.createLabel({ text : title, textAlign : 'center', color : '#000000', font : { fontSize : 12, fontWeight : '' }, }); view.add(text);
return view; }; var table = Ti.UI.createTableView({ headerTitle:'Header Title',
headerView: createCustomView('MÃ¥ndag 19 mars 2012'),
footerView: createCustomView('Tisdag 19 mars 2012') });
var tableData = []; var xhr = Ti.Network.createHTTPClient({ onload: function() { // Ti.API.debug(this.responseText);
json = JSON.parse(this.responseText);
for (i = 0; i < json.lista.length; i++) {
lista = json.lista[i];
row = Ti.UI.createTableViewRow({
hasChild:true,
height:'60',
});
nameLabel = Ti.UI.createLabel({
text:lista.name,
font:{
fontSize:'16',
fontWeight:'bold'
},
height:'auto',
left:'5',
top:'12',
color:'#000',
});
nickLabel = Ti.UI.createLabel({
text: lista.nickname,
font:{
fontSize:'12'
},
height:'auto',
left:'5',
bottom:'12',
color:'#000',
});
timeeLabel = Ti.UI.createLabel({
text:lista.timee,
font:{
fontSize:'12'
},
height:'auto',
left:'240',
bottom:'12',
color:'#000',
});
timmarLabel = Ti.UI.createLabel({
text:lista.timmar,
font:{
fontSize:'16',
fontWeight:'bold'
},
height:'auto',
left:'240',
top:'12',
color:'#000',
});
row.add(nameLabel);
row.add(nickLabel);
row.add(timeeLabel);
row.add(timmarLabel)
tableData.push(row);
}
table.setData(tableData); }, }); xhr.open("GET", url); xhr.send(); win2.add(table); win2.open(
you can a view as container and add your footerview on top most position, add new view at bottom position, and set container as footerview of table that can be visualize as two view.
Your Answer
Think you can help? Login to answer this question!