ios--万能点击事件,给label等控件添加点击事件

UITapGestureRecognizer *labelTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(labelClick)];
[self.UserRate addGestureRecognizer:labelTapGestureRecognizer];

self.UserRate.userInteractionEnabled = YES; // 可以理解为设置label可被点击

posted on 2017-01-11 15:09  麦芽呀~  阅读(448)  评论(0编辑  收藏  举报