How to make tableview continue after footerview?

You must Login before you can answer or comment on any questions.

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

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.

— answered 1 year ago by Gaurang Chhatbar
answer permalink
2 Comments
  • Do u know how that code could look like?

    — commented 1 year ago by David Fjordland

  • I think you are asking about the header for each division of records. try out this code and put backgroundImage for rows when you want the header in your table.

    var win = Ti.UI.createWindow({title : "TableView demo"});
     
    var rowArr = [];
    for(i=0;i<30;i++){
        var row = Ti.UI.createTableViewRow({
            height : 50,
            backgroundColor : 'white',
            title : i.toString()
        });
        if(i%5==0){
            row.backgroundColor = "gray";
            row.height = 30;
        }
        rowArr.push(row);
    }
     
    var tableview = Ti.UI.createTableView({
        data : rowArr
    });
     
    win.add(tableview);
     
    win.open();

    — commented 1 year ago by Gaurang Chhatbar

Your Answer

Think you can help? Login to answer this question!