Titanium.UI.createAlertDialog
学习TI 记录一下
1.确认对话框
Js代码
var a = Titanium.UI.createAlertDialog({
title:'添加人员信息',
message:"人员添加成功",
buttonNames: ['确定']
});
//a.addEventListener('click', function(e) {
// alert("Now you should see this one, assuming you dismissed the first alert");
//});
a.show();
2.可选对话框
Js代码
var dialog = Titanium.UI.createOptionDialog({
title: '添加人员信息',
options: ['成功','失败'],
cancel:1
});
dialog.show();
3.自定义对话框
Js代码
var minDate = new Date();
minDate.setFullYear(2009);
minDate.setMonth(0);
minDate.setDate(1);
var maxDate = new Date();
maxDate.setFullYear(2009);
maxDate.setMonth(11);
maxDate.setDate(31);
var value = new Date();
value.setFullYear(2009);
value.setMonth(0);
value.setDate(1);
var view=Ti.UI.createView({
height:100,
width:100
});
var picker = Ti.UI.createPicker({
type:Ti.UI.PICKER_TYPE_DATE_AND_TIME,
minDate:minDate,
maxDate:maxDate,
value:value
});
// turn on the selection indicator (off by default)
picker.selectionIndicator = true;
view.add(picker);
var dialog = Titanium.UI.createAlertDialog({
title:'添加人员信息',
message:"人员添加成功",
androidView:view
});
dialog.show();
4.发送邮件对话框
Js代码
var emailDialog = Titanium.UI.createEmailDialog();
if (!emailDialog.isSupported()) {
Ti.UI.createAlertDialog({
title:'Error',
message:'Email not available'
}).show();
return;
}
emailDialog.setSubject('Hello from Titanium!');
emailDialog.setToRecipients(['foo@yahoo.com']);
emailDialog.setCcRecipients(['bar@yahoo.com']);
emailDialog.setBccRecipients(['blah@yahoo.com']);
if (Ti.Platform.name == 'iPhone OS') {
emailDialog.setMessageBody('Appcelerator Titanium Rocks!å');
emailDialog.setHtml(true);
emailDialog.setBarColor('#336699');
} else {
emailDialog.setMessageBody('Appcelerator Titanium Rocks!');
}
// attach a blob
emailDialog.addAttachment(event.media);
// attach a file
var f = Ti.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, 'cricket.wav');
emailDialog.addAttachment(f);
emailDialog.addEventListener('complete',function(e)
{
if (e.result == emailDialog.SENT)
{
if (Ti.Platform.osname != 'android') {
// android doesn't give us useful result codes.
// it anyway shows a toast.
alert("message was sent");
}
}
else
{
alert("message was not sent. result = " + e.result);
}
});
emailDialog.open();
Titanium.UI.createAlertDialog的更多相关文章
- Titanium系列--利用js动态获取当前时间
动态获取时间: //显示时间 function getDateTime() { var now = new Date(); var year = now.getFullYear(); var mont ...
- 一些Titanium学习的地方
利用titanium兑现外汇兑换计算的ios代码 http://rensanning.iteye.com/blog/1325011 Titanium兑现相关的报表功能 http://www.s ...
- Titanium.App.Properties 对象
Titanium.App.Properties是用来管理键值对数据的一个很方便的对象.在保存数据的时候,在Ti.App.Properties.setString相对应的Key的值中设置你要保存的值即可 ...
- How PhoneGap & Titanium Works
转载自 http://www.appcelerator.com/blog/2012/05/comparing-titanium-and-phonegap/ How PhoneGap Works As ...
- Titanium系列--利用Titanium开发android App实战总结
1. Titanium中,通过ImageView Controller 显示图片,图片地址要放在app/assets下,然后自己建一个文件夹,把图片放在这里.如下图,然后alloy代码:<Ima ...
- Titanium系列--Titanium的简介、Titanium Studio安装和配置(一)
1. 是什么?--是一个可以通过javascript,html,css等web技术开发移动App的的开发框架,媲美原生App体验和性能,目前支持IOS和Android平台. 2. 为什么能做这个? - ...
- 跨平台移动开发工具:PhoneGap与Titanium全方位比拼
PhoneGap和Appcelerator Titanium,对于封装和配置移动应用程序而言,二者都是非常受欢迎的开源JavaScript框架.本文为Appcelerator开发者Kevin Whin ...
- 创新高性能移动 UI 框架-Canvas UI 框架
WebView 里无法获得的能力虽然是「体验增强」与「端基本能力」,但现都基本上有成熟解决方法.但后期的 UI 和 Layout 的性能反而是目前 Web 技术欠缺的.所以,无论是 Titanium ...
- 避免重复造轮子的UI自动化测试框架开发
一懒起来就好久没更新文章了,其实懒也还是因为忙,今年上半年的加班赶上了去年一年的加班,加班不息啊,好了吐槽完就写写一直打算继续的自动化开发 目前各种UI测试框架层出不穷,但是万变不离其宗,驱动PC浏览 ...
随机推荐
- 【腾讯Bugly干货分享】微信终端跨平台组件 Mars 系列 - 我们如约而至
导语 昨天上午,微信在广州举办了微信公开课Pro.于是,精神哥这两天的朋友圈被小龙的"八不做"刷屏了.小伙伴们可能不知道,下午,微信公开课专门开设了技术分论坛.在分论坛中,微信开源 ...
- 闲话Promise机制
Promise的诞生与Javascript中异步编程息息相关,js中异步编程主要指的是setTimout/setInterval.DOM事件机制.ajax,通过传入回调函数实现控制反转.异步编程为js ...
- ABP(现代ASP.NET样板开发框架)系列之6、ABP依赖注入
点这里进入ABP系列文章总目录 基于DDD的现代ASP.NET开发框架--ABP系列之6.ABP依赖注入 ABP是“ASP.NET Boilerplate Project (ASP.NET样板项目)” ...
- ABP源码分析四十五:ABP ZERO中的EntityFramework模块
AbpZeroDbContext:配置ABP.Zero中定义的entity的Dbset EntityFrameworkModelBuilderExtensions:给PrimitiveProperty ...
- APUE中fcntl.h的使用及O_SYNC在Mac与Ubuntu下的测试
此部分测试涉及到APUE V3中,第三章的图3-12到图3-14. 通过fcntl.h提供的功能,修改fd的文件属性,本处增加O_SYNC功能,并测试其效果. 本文涉及代码: tree ch3 ch3 ...
- 警告: [unchecked] 对作为原始类型IScheme的成员的write(TProt ocol,T)的调用未经过检查
jdk 从8 改成了7 就好了! 或者, 修改源码, 每个响应的地方加上 surppressingWarnings xxx , 或者使用 请使用 -Xlint:unchecked 重新编译. 参照 h ...
- HTML5之应用缓存---manifest---缓存使用----Web前端manifest缓存
相信来查这一类问题的都是遇到问题或者是初学者吧! 没关系相信你认真看过之后就会知道明白的 这是HTML5新加的特性 HTML5 引入了应用程序缓存,这意味着 web 应用可进行缓存,并可在没有因特网连 ...
- 我为NET狂官方群福利贴:一些常用的工具:2016-08-01更新
本次更新下载:http://pan.baidu.com/s/1skXzG4H 源码文档见官方群(以下为8.1更新内容) 逆天工具 CDN 资源库 国内 http://www.bootcdn.cn/ h ...
- HTML5 之拖放(drag与drop)
拖放(Drag 和 drop)是 HTML5 标准的组成部分. 拖放是一种常见的特性,即抓取对象以后拖到另一个位置. 在 HTML5 中,拖放是标准的一部分,任何元素都能够拖放. HTML5 拖放实例 ...
- 三个不常用的HTML元素:<details>、<summary>、<dialog>
前面的话 HTML5不仅新增了语义型区块级元素及表单类元素,也新增了一些其他的功能性元素,这些元素由于浏览器支持等各种原因,并没有被广泛使用 文档描述 <details>主要用于描述文档或 ...