以下に示すような構成で にUITextView
接続されているを使用します。UITableViewCell
cell.topicAndDescriptionTextView = [[UITextView alloc] initWithFrame:frame];
cell.topicAndDescriptionTextView.tag = 1;
cell.topicAndDescriptionTextView.attributedText = attrText;
cell.topicAndDescriptionTextView.scrollEnabled = NO;
cell.topicAndDescriptionTextView.editable = NO;
cell.topicAndDescriptionTextView.textContainer.lineFragmentPadding = 0;
cell.topicAndDescriptionTextView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0);
cell.topicAndDescriptionTextView.backgroundColor =[UIColor clearColor];
[cell.topicAndDescriptionTextView setUserInteractionEnabled:YES];
cell.topicAndDescriptionTextView.dataDetectorTypes = UIDataDetectorTypeAll;
テキスト キット機能を使用して、属性付きテキスト ( http://www.raywenderlich.com/48001/easily-overlooked-new-features-ios-7#textViewLinks )のカスタム リンクのタップを検出- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
し、顧客がUITableViewCell
カスタム リンクのない場所をクリックした場合のドリルダウン。
残念ながら[UITextView setUserInteractionEnabled:YES]
、テキストビューはすべてのタッチを飲み込みます。これを達成するための最良のアプローチは何ですか?カスタムUITextView
クラスを作成してUITextView
デリゲートを使用することを考えましたが、スーパー クラスがリンクのプレスを既に処理しているかどうかを特定し、ドリルダウンをブロックするにはどうすればよいでしょうか。
THX、
1月