【发布时间】:2016-07-02 08:37:12
【问题描述】:
我在项目内有带有按钮的列表视图。我已经设置了一个点击事件函数,但它不返回点击按钮的属性。在 iOS 中它运行良好。
var item = {
properties : {
accessoryType: Ti.UI.LIST_ACCESSORY_TYPE_NONE,
backgroundColor: '#fff',
width: Ti.UI.FILL,
height : Ti.UI.SIZE
},
events: {
click: eventFunction
},
childTemplates : [
{
type : 'Ti.UI.Button',
bindId : 'bindButton',
properties : {
width: 70,
height: 70,
image: "/images/user_icon.png",
borderRadius: 35,
borderWidth: 1,
borderColor: '#dedede',
zIndex: 1,
backgroundColor: 'transparent',
idButton : 10
}
当我单击 eventFunction 中的按钮时,我希望找到 e.source.idButton 但 e.source 不包含它。为什么?在 iOS 中,我找到了预期的属性。 我试过在按钮模板中移动事件参数,但结果是一样的。
【问题讨论】:
标签: android listview events button appcelerator