2011-05-20 81 views
1

我的UITextView設置在Interface Builder中檢測電話號碼和超鏈接的設置在哪裏?我想我已經看到了某個地方的選擇,但我忘記了在哪裏。UITextView設置檢測電話號碼和超鏈接

+0

可能重複[可以將文本字段的自動識別電話號碼和鏈接?](http://stackoverflow.com/questions/6053778/can-text-fields-auto-recognize-phone-numbers-and - 鏈接) – 2011-06-02 02:55:00

回答

3

Text View Attributes中有一個字段,其內容爲Detection。從那裏選擇你喜歡的任何選項 - 電話號碼,地址,活動,鏈接。

+0

它在屬性視圖中是不是? – 2011-05-22 13:57:56

+0

啊我找到了。首先需要滾動 – 2011-05-22 13:58:40

0

這裏是我的代碼。

-(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; 
} 
相關問題