我不知道这有什么错我code.When我点击该按钮,方法不perform.this是我的代码:蹊跷JSPatch
configView: function() {
var button = UIButton.buttonWithType(0);
button.setFrame({x:10,y:10,width:100,height:100});
button.setTitle_forState('touch me',0);
self.view().addSubView(button);
button.setBackgroundColor(UIColor.redColor());
button.setCenter(self.view().center());
button.addTarget_action_forControlEvents(self,'touch',0);
},
touch:function(){
console.log('touchme');
}
难道这是问题? button.addTarget_action_forControlEvents(self,'touch',0)
对不起,在我的代码,'UIButtonTypeCustom UIControlStateNormal'为0这样'VAR键= UIButton.buttonWithType(0); button.setTitle_forState('touch me',0);' – hmxxxhhh
你的评论应该是什么意思? – Davesexcel
@Davesexcel我告诉你的代码是wory,我很抱歉 – hmxxxhhh