开发者

In Titanium how do I execute a button click event from code?

I t开发者_开发百科ried

btn.click();

And the error message is 'Cannot call property click in object ti.modules.titanium.ui.ButtonProxy@44f61. It is not a function, it is "object"'


btn.fireEvent('click');

this should work


btn.addEventListener('click',function() {
    Titanium.API.info('Button Clicked');

});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜