zoukankan      html  css  js  c++  java
  • titanium开发教程0407增加rows

    1

    // this sets the background color of the master UIView (when there are no windows/tab groups on it)
    Titanium.UI.setBackgroundColor('#000');
    
    // create tab group
    var tabGroup = Titanium.UI.createTabGroup();
    
    var win = Titanium.UI.createWindow({  
        title:"Main Window",
        backgroundColor:"#FFFFFF",
        //navBarHidden:true, //Hide the nav bar for the window
        tabBarHidden:true //Hide the tab bar for the window
    });
    var tab = Titanium.UI.createTab({  
        icon:"KS_nav_views.png",
        title:"Main Tab",
        window:win
    });
    
    var data = [
    	{title:"Backpack Cal", leftImage:"images/01-backpack-cal-thumb.png", className:"tableRow", hasCheck:true},
    	{title:"California Calm", leftImage:"images/02-calm-cal-thumb.png", className:"tableRow", hasDetail:true},
    	{title:"California Hotsprings", leftImage:"images/03-hotsprings-cal-thumb.png", className:"tableRow", hasChild:true},
    	{title:"Cycle California", leftImage:"images/04-cycle-cal-thumb.png", className:"tableRow"},
    	{title:"From Desert to Sea", leftImage:"images/05-desert-cal-thumb.png", className:"tableRow"},
    	{title:"Kids California", leftImage:"images/06-kids-cal-thumb.png", className:"tableRow"},
    	{title:"Nature Watch", leftImage:"images/07-nature-watch-cal-thumb.png", className:"tableRow"},
    	{title:"Snowboard Cali", leftImage:"images/08-snowboard-cal-thumb.png", className:"tableRow"},
    	{title:"Taste of California", leftImage:"images/09-taste-cal-thumb.png", className:"tableRow"}
    ]
    
    var tableView = Titanium.UI.createTableView({
    	data:data
    });
    
    //Tap a row to add a new one
    tableView.addEventListener("click",function(e){
    	var row = Titanium.UI.createTableViewRow({
    		title:"Row added",
    		height:"auto"
    	});
    	tableView.appendRow(row);
    	//insert a new row after row index 2, the third row (indexing starts at 0)
    	//tableView.insertRowAfter(2,row);
    })
    
    win.add(tableView);
    
    tabGroup.addTab(tab);  
    
    // open tab group
    tabGroup.open();
  • 相关阅读:
    JavaScript-创建日志调试对象(面向对象实例)
    公有属性 公有方法(原型方法) 私有属性 私有方法 特权方法 静态属性 静态方法 对象字面量创建
    JS库创建
    无post按钮提交表单
    当浏览器窗口大小改变时,设置显示内容的高度
    单元测试(qunit)
    HTML定位(滚动条、元素,视口)定位
    document.compatMode(判断当前浏览器采用的渲染方式)
    jquery自定义方法
    jQuery选择器总结
  • 原文地址:https://www.cnblogs.com/xiaozhanga4/p/2403290.html
Copyright © 2011-2022 走看看