美文网首页
获取textview自动识别的手机号

获取textview自动识别的手机号

作者: Q6尐漒 | 来源:发表于2016-09-01 13:12 被阅读437次

//文字内容

self.content = [[UITextView alloc] initWithFrame:CGRectMake(55, KViewContentY, LNScreenWidth-110, 80)];

//RGB_Color(80.0, 113.0, 126.0);

//    [self.content setTitleColor:[UIColor colorWithRed:80/255.0 green:113/255.0 blue:126/255.0 alpha:1] forState:UIControlStateNormal];

self.content.tag = 1011;

self.content.font = [UIFont systemFontOfSize:CONTENTSIZE];

self.content.backgroundColor=[UIColor clearColor];

self.content.editable = NO;

self.content.dataDetectorTypes = UIDataDetectorTypeAll;

self.content.font = [UIFont systemFontOfSize:15];

self.content.scrollEnabled = NO;

self.content.delegate = self;

self.content.userInteractionEnabled = YES;

[self.content setBackgroundColor:[UIColor clearColor]];

[view addSubview:self.content];

- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange {

NSLog(@"url :%@",URL);

if ([[URL scheme] isEqualToString:@"tel"]) {

if (_delegate && [_delegate respondsToSelector:@selector(callPhone)]) {

[_delegate callPhone];

}

return NO;

}

return YES;

}

相关文章

网友评论

      本文标题:获取textview自动识别的手机号

      本文链接:https://www.haomeiwen.com/subject/pgqmlttx.html