zoukankan      html  css  js  c++  java
  • titanium开发教程0301理解tab group

    12

    Titanium.UI.setBackgroundColor("#000");
    
    // 创建 tab group
    var tabGroup = Titanium.UI.createTabGroup();
    
    //第一件事你要注意当 Tab Groups开始工作的时候
    //tab group 函数作为控制 "window"
    //每一个 tab 有自己的 window 作为一个单独的运行环境
    //要记住的是,你要手动传送数据
    //windows 是单独运行的
    
    //我们将创建两个tabs: tours 和 specials
    
    //Tours tab 和 window
    var toursWindow = Titanium.UI.createWindow({  
        title:"Tours",
        backgroundColor:"#FFFFFF"
    });
    
    var image = Titanium.UI.createImageView({
    	image:"images/exploreCalifornia.png",
    	96,
    	height:119,
    });
    
    var caption = Titanium.UI.createLabel({
    	text:"Explore California Tours",
    	bottom:20,
    	height:"auto",
    	"auto",
    	textAlign:"center",
    	color:"#000000"
    });
    
    toursWindow.add(image);
    toursWindow.add(caption);
    
    var toursTab = Titanium.UI.createTab({  
        icon:"tours-tab.png",
        title:"Tours",
        window:toursWindow	//设置tab的window 不是一个变量引用一个窗口
    });
    
    //Specials window
    var specialsWindow = Titanium.UI.createWindow({  
        title:"Specials",
        backgroundColor:"#FFFFFF",
        url:"specials.js"	//这是一个参考一个外部js文件,可以作为窗口为这个标签
    });
    var specialsTab = Titanium.UI.createTab({  
        icon:"specials-tab.png",
        title:"Specials",
        window:specialsWindow
    });
    
    
    tabGroup.addTab(toursTab);  
    tabGroup.addTab(specialsTab);
    
    tabGroup.open();
  • 相关阅读:
    爬虫的基础知识(贰)
    Django内置标签
    WPF ToggleButton Style
    编写一个简单的COM组件
    C# 调用DOS 命令
    【转】 C#中检查网络是否连通的二种方法
    c++中的类型转换
    COM笔记-包容与聚合
    windows笔记-在可执行文件或DLL的多个实例之间共享静态数据
    编程之路
  • 原文地址:https://www.cnblogs.com/xiaozhanga4/p/2402982.html
Copyright © 2011-2022 走看看