UITextView link detection in iOS 7

后端 未结 17 1320
再見小時候
再見小時候 2020-12-01 10:22

I have a UITextView which is managed via Interface Builder. As data detection I have \"Links\" checked. In iOS 6 everything is working fine and links are highli

17条回答
  •  佛祖请我去吃肉
    2020-12-01 10:36

    If you are adding UITextview programmatically just add below lines:

            _textView.userInteractionEnabled = YES;
            _textView.dataDetectorTypes = UIDataDetectorTypeLink;
            _textView.scrollEnabled = NO;
            _textView.editable = NO;
    

    This worked for me.

提交回复
热议问题