【问题标题】:UITextView setting to detect phone numbers and hyperlinksUITextView 设置来检测电话号码和超链接
【发布时间】:2011-05-20 04:31:27
【问题描述】:

我的UITextView 在 Interface Builder 中检测电话号码和超链接的设置在哪里?我想我在某处看到过该选项,但我忘记了在哪里。

【问题讨论】:

标签: iphone objective-c ios interface-builder uitextview


【解决方案1】:

Text View Attributes 中有一个字段为 Detection。从那里选择您喜欢的任何选项——电话号码、地址、事件、链接。

【讨论】:

  • 属性视图不是吗?
  • 啊,我找到了。需要先滚动
【解决方案2】:

这是我的代码。

-(UITextView *) content {
    if (!_content) {
        _content = [[UITextView alloc] initWithFrame:self.view.bounds];
        _content.font =[UIFont fontWithName:@"Arial" size:20];
        _content.backgroundColor = [UIColor blackColor];
        _content.editable = NO;
        _content.dataDetectorTypes = UIDataDetectorTypeAll;
        _content.text = @"my phone  is 18882222999 \r\n and my website is http://www.stackoverflow.com \r\n and I was born 1918-08-22\r\n";
    }
    return _content;
}

【讨论】:

    猜你喜欢
    • 2010-11-02
    • 2011-09-03
    • 2011-05-30
    • 1970-01-01
    • 1970-01-01
    • 2012-07-10
    • 2019-04-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多