iOS 给UILabel增加超链接
时间:2015-03-27 17:25:25
收藏:0
阅读:696
UITapGestureRecognizer*tapRecognizer1=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(clickurl1:)];
self.inviteLabel.userInteractionEnabled=YES;
self.inviteLabel.userInteractionEnabled=YES;
[self.inviteLabel addGestureRecognizer:tapRecognizer1];
- (void)clickurl1:(id)sender{
#warning 网址换一下
NSString *path=self.url;
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:path]];
}
原文:http://blog.csdn.net/darongzi1314/article/details/44678669
评论(0)