zoukankan      html  css  js  c++  java
  • titanium开发教程0403创建一个简单的table

    1hasDetail在android上无法显示

    // 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
    });
    
    //Method for simple table row creation
    //1. Store all the data we need in an array of objects
    //2. Set the array as the data source for our TableView
    
    //For a simple table, the following properties are valid:
    //title: The title of the row
    //leftImage: The image to appear at the left of the row
    //className: A name for rows that have similar structure (this helps with table performance)
    //hasCheck: render a check to the right of the row
    //hasChild: render a grey arrow to the right of the row
    //hasDetail: renders a blue circle w/arrow at the right of the row
    //**NOTE: to set the rightImage property, you'll need to use the createTableRow method
    
    //1. Store all the data we need in an array of objects
    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({
    	//2. Set the array as the data source for our TableView
    	data:data
    });
    
    win.add(tableView);
    
    tabGroup.addTab(tab);  
    
    // open tab group
    tabGroup.open();
  • 相关阅读:
    Java字符串操作
    easyui Combotree根据用户输入显示对应的tree值
    maven
    引用 js表单验证大全 以后方便查看用
    对象内存模型
    高级性能服务器编程模型【IOCP完成端口】开发实现【一】
    高级性能服务器编程模型【IOCP完成端口】开发实现【二】
    高级性能服务器编程模型【IOCP完成端口】开发实现【三】
    探讨【IGE】的源代码【六】,承接【五】,内存池管理。
    hive beeline详解
  • 原文地址:https://www.cnblogs.com/xiaozhanga4/p/2403215.html
Copyright © 2011-2022 走看看