【发布时间】:2013-11-21 15:48:49
【问题描述】:
我在 Titanium 中创建了一个 OptionDialog。我已经从动态数组中添加了这些选项列表。如何在点击对话框中的任何项目时获得特定的选项值?
var View = Ti.UI.createTextField({
height : '60dp',
width : '90%',
value : 'click here'
)};
myArray = ['Lion','Tiger','Cat','Elephant','Dog'];
var opts = {
cancel: 2,
options: myArray,
selectedIndex: 2,
destructive: 0,
};
var dialog;
View.addEventListener('click',function(){
dialog = Ti.UI.createOptionDialog(opts).show();
});
我已经尝试过如下方法,但不起作用。
dialog.addEventListener('click',function(e){
alert('You Clicked' + e.source.options);
});
【问题讨论】:
-
您使用的是哪个操作系统?安卓还是ios?
标签: titanium appcelerator titanium-mobile