Use the Titanium.Platform.DisplayCaps.platformWidth
property to get the size of the window, assuming that the #tableview
's parent is the app window:
#tableview : {
width : Titanium.Platform.DisplayCaps.platformWidth - 50,
height: "98%",
top:0
}
Option 2 is you can calculate this inside your controller using the postlayout
event like this:
function adjustTableWidth(e) {
$.tableView.width = $.tableView.rect.width - 50;
// Remove the listener so it doesn't keep calling infinitely
$.tableview.removeEventListener('postlayout, adjustTableWidth);
}
$.tableview.addEventListener('postlayout, adjustTableWidth);
Just make sure if you use option two, you set the TSS to this:
"#tableView": {
width: "100%",
height: "98%",
top:0
}