i create simple table view application that display some data in tableViewRow.. for now, i only use fixed measurement here’s my code :
function addTableView(){
var tableData = [];
for (var i = 0; i<10; i++){
var row = Ti.UI.createTableViewRow({
className:'forumEvent', // used to improve table performance
rowIndex:i, // custom property, useful for determining the row during events
selectionStyle:0,
});
var checkBox = Ti.UI.createSwitch({
style:Ti.UI.Android.SWITCH_STYLE_CHECKBOX,
value:false,
left:5
});
var lblField = Ti.UI.createLabel({
realValue: 'Value',
text:'Field : Value',
font:{fontFamily:'Arial', fontSize:DefaultFontSize, fontWeight:'normal'},
color:'#222',
top:5,
left:80
});
var lblField2 = Ti.UI.createLabel({
realValue: 'Value',
text:'Field : Value',
font:{fontFamily:'Arial', fontSize:DefaultFontSize, fontWeight:'normal'},
color:'#222',
top:35,
left:80
});
var lblField3 = Ti.UI.createLabel({
realValue: 'Value',
text:'Field : Value',
font:{fontFamily:'Arial', fontSize:DefaultFontSize, fontWeight:'normal'},
color:'#222',
top:65,
left:80
});
row.add(checkBox);
row.add(lblField);
row.add(lblField2);
row.add(lblField3);
checkBox.addEventListener('click',function(e){
alert(checkBox.toImage().width);
});
tableData.push(row);
}
var tempTable = Titanium.UI.createTableView({
data:tableData,
editable: Titanium.Platform.osname === 'iphone' ? true : false,
name:'Picking table'
});
return tempTable;
}
in bigger screen, it can display perfectly like this:

but if i change my emulator screen into QVGA, it can’t display like before, like this:

has anyone know how to create relative layout, so it can display perfectly in both small and large screen? thanks before..
Michael, Take a look at the following links, it might also be useful for you