UIButton*btn2=[[UIButtonalloc]initWithFrame:CGRectMake(0,38,100,38)];[btn2setTitle:@"添加好友"forState:UIControlStateNormal];btn2.titleLabel.font=[UIFontsystemFontOfSize:16];[btn2addTarget:selfaction:@selector(btn2Click:)forControlEvents:UIControlEventTouchDown];之前可以触发,现在不知是何原因不能触发了?
2 回答
墨色风雨
TA贡献1853条经验 获得超6个赞
改成如下代码再试试UIButton*btn2=[[UIButtonalloc]initWithFrame:CGRectMake(0,38,100,38)];[btn2setTitle:@"添加好友"forState:UIControlStateNormal];btn2.titleLabel.font=[UIFontsystemFontOfSize:16];[btn2addTarget:selfaction:@selector(btn2Click:)forControlEvents:UIControlEventTouchUpInside];
添加回答
举报
0/150
提交
取消