tableview positioning

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

Hi everyone, im working with a titanium android project where i have to place a tableview on the bottom of the screen. The tableview maximum height should be 1/3 of the screen.The height cant be fixed because there is dynamic content, and the tableview should not be higher than the content. It seems like bottom:0 doesnt do anything, it has to be positioned from the top?

Could any1 give me some hints about this positioning ?

I would also like a toggle button on top of the table where i can toggle show / hide the tableview.

Hope some1 could help me with this. Im really stuck.

Thanks alot .

— asked 8 months ago by Tom Jakobsen
1 Comment
  • You will need to 'remember' the height of the other content and then set the top parameter of the table to that value. Then calculate the remaining screen space and specify the height parameter of the table to that value. Does that help?

    — commented 8 months ago by Chris Dunstall

1 Answer

Hi, You can create tableview like this :

Table = Ti.UI.createTableView({
                bottom : 0,
                width : 320,
                height : 160,
                backgroundColor : 'transparent',
                separatorColor : 'transparent',
                headerView : tableHeaderView,// if you want to add any view as table header
            });

— answered 8 months ago by Moiz Chhatriwala
answer permalink
1 Comment
  • Hi. Thank you. I know that much, but the problem is that i have to set a maximum height of that tableview. It should not be > 33% of the window. This because the content is dynamic and if there is only 1 row, it should be on the bottom of the screen. If there is rows that covers > 33% of the screen it should scroll.

    Thanks

    Tom

    — commented 8 months ago by Tom Jakobsen

Your Answer

Think you can help? Login to answer this question!