我需要使用titanium appcelerator在android中隐藏自定义表格行我正在使用一些ui控件创建表格行,当我隐藏特定行时,整行将不会显示,并且UI会根据remaing行进行调整,为此我编写了以下代码。
Ti.UI.backgroundColor = 'white';
var win = Ti.UI.createWindow();
var row1 = Ti.UI.createTableViewRow({
height:'auto',
selectionStyle:Ti.UI.iPhone.TableViewCellSelectionStyle.NONE
});
var label1 = Titanium.UI.createLabel({
text:'Username',
left: 10
});
var usernametf = Ti.UI.createTextField({
left: 100,
right:10,
hintText: 'username',
textAlign:"right",
borderStyle: Ti.UI.INPUT_BORDERSTYLE_NONE
});
var row2 = Ti.UI.createTableViewRow({
height:'auto',
selectionStyle:Ti.UI.iPhone.TableViewCellSelectionStyle.NONE
});
var label2 = Titanium.UI.createLabel({
text:'Password',
left: 10
});
var passwordtf = Ti.UI.createTextField({
left: 100,
textAlign:"right",
hintText: 'reenter password',
right:10,
passwordMask:true,
borderStyle: Ti.UI.INPUT_BORDERSTYLE_NONE
});
///row3
var row3 = Ti.UI.createTableViewRow({
height:'auto',
selectionStyle:Ti.UI.iPhone.TableViewCellSelectionStyle.NONE
});
var label23 = Titanium.UI.createLabel({
text:'Password',
left: 10
});
var passwordtf123 = Ti.UI.createTextField({
left: 100,
textAlign:"right",
hintText: 'password',
right:10,
passwordMask:true,
borderStyle: Ti.UI.INPUT_BORDERSTYLE_NONE
});
row2.hide();
row1.add(label1);
row1.add(usernametf);
row2.add(label2);
row2.add(passwordtf);
row3.add(label23);
row3.add(passwordtf123);
var data = [row1,row2,row3];
var table = Ti.UI.createTableView({
// data: tableData
data:data,
});
win.add(table);
win.open();
how i hide tablerow2 and adjust the ui of theremaining rows please see and let me know further details.
Thanks in Advance......