我不知道這有什麼錯我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