来自文本字段的钛金移动日期选择器 [英] titanium mobile date picker from text field

查看:59
本文介绍了来自文本字段的钛金移动日期选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要执行以下操作: 当人们单击文本字段时,他们会看到一个日期选择器. 他们点击顶部的完成"按钮,日期选择器消失 他们又回到了表格上. 我该如何使用钛金属手机将其用于iPhone ios?

I want to do the following: when people click on a text field they see a date picker. they click "done" button at the top and the date picker disappears and they are back on the form. How can I accomplish this using titanium mobile for iphone ios?

推荐答案

您可以使用Textbox AddeventListener和Animation函数.喜欢

You can use Textbox AddeventListener and Animation function. like

var donebtn = Ti.UI.createButton({
title : "Done",

});

var toolbar_pick    = Ti.UI.iOS.createToolbar({
      backgroundColor : "#f00",
      bottom        : -50,
      items       :[donebtn],
      barColor      :'#000',

});

var _date = Ti.UI.createPicker({
    type:Ti.UI.PICKER_TYPE_DATE,
    minDate : new Date,
    bottom :-320 ,
});
donebtn.addEventListener('focus',function(){
     _date.animate({bottom:-270, duration: 500});
     toolbar_pick.animate({bottom:-50, duration: 500});

});
textbox.addEventListener('click',function(){
    _date.animate({bottom:0, duration: 500});
    toolbar_pick.animate({bottom:266, duration: 500});


});
win.add(_date);
win.add(toolbar_pick);

例如,

可以使用自己的要求.

just for example can use own your requirement.

捷运

这篇关于来自文本字段的钛金移动日期选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆