zoukankan      html  css  js  c++  java
  • titanium开发教程0205创建单行的选择器

    1

    var win = Titanium.UI.createWindow({
    	title:"Creating a Single-Column Picker",
    	backgroundColor:"#FFF",
    	exitOnClose:true
    });
    
    //A single column picker
    var picker = Titanium.UI.createPicker({
    	bottom:0,
    	selectionIndicator:true //This is the blue translucent window (on iOS) that indicates the current selection
    });
    
    //A picker requires an array of pickerRow objects
    var data = [];	//Create an array; next, fill with pickerRow objects
    data[0] = Titanium.UI.createPickerRow({title:"Backpack Cal", val:"Hiking"}); //Create a new picker row with the minimum of a title property (text that is displayed to the user; the other properties are custom and drawn up in the event listener)
    data[1] = Titanium.UI.createPickerRow({title:"California Calm", val:"Resting"});
    data[2] = Titanium.UI.createPickerRow({title:"California Hotsprings", val:"Bathing"});
    data[3] = Titanium.UI.createPickerRow({title:"Cycle California", val:"Biking"});
    
    //Now, we need add the pickerRow objects in the data array to the picker
    picker.add(data);
    
    //This label contains text that will change with each picker change
    var results = Titanium.UI.createLabel({
    	text:"Select from the picker below",
    	height:40,
    	"auto",
    	top:20	
    });
    
    //When using a picker, listen for the "change" event
    picker.addEventListener("change", function(e){
    	results.text = e.row.title + ": " + e.row.val; //Pull the title and val properties from the selected pickerRow object (accessed via e.row)
    });
    
    win.add(picker);
    win.add(results);
    
    win.open();
  • 相关阅读:
    首次成功实施 XSS 攻击,盗取目标网站大量 VIP 帐号
    框架模块设计经验总结
    OEA ORM 框架中的冗余属性设计
    UML 图使用心得
    Scrum 流程应用反思 我们的团队
    分享一个简单的 VS 插件及源码
    PDA使用感悟
    OEA 框架中集成的 RDLC 报表介绍
    私活后的 WPF 设计经验总结
    个人管理/时间管理 辅助工具套件分享
  • 原文地址:https://www.cnblogs.com/xiaozhanga4/p/2402637.html
Copyright © 2011-2022 走看看