binladen
binladen
  • 发布:2017-07-25 09:30
  • 更新:2017-07-25 11:09
  • 阅读:1024

原生view控件添加事件不起作用!

分类:HTML5+

代码如下:
是写错了吗?

var coupon = new plus.nativeObj.View('coupon', {  
                    width: '100%',  
                    height: '100%',  
                    backgroundColor: 'rgba(0,0,0,0.5)'  
                }, [{  
                    id:'bitmapCoupon',  
                    tag: 'img',  
                    src: 'images/coupon_content_bg.png',  
                    sprite: {  
                        width: '100%'  
                    },  
                    position: {  
                        width: '100%',  
                        height: '65%',  
                        top: '10%'  
                    }  
                }, {.....  
coupon.addEventListener('click', function(){  
    console.log(plus.nativeObj.View.getViewById('bitmapCoupon'))  
});
2017-07-25 09:30 负责人:无 分享
已邀请:
binladen

binladen (作者)

@DCloud_客服_Trust
@DCloud_App_Array
@踩着单车载着猪

该问题目前已经被锁定, 无法添加新回复