我正在尝试使用可点击链接重复使用DTAttributedTextCell。我可以抓住attributesstring,但我不知道如何获取文本的框架,以便我可以创建一个DTLinkButton。
以下是Demoapp的示例代码:
- (void)configureCell:(DTAttributedTextCell *)cell forIndexPath:(NSIndexPath *)indexPath
{
NSDictionary *snippet = [_snippets objectAtIndex:indexPath.row];
NSString *title = [snippet objectForKey:@"Title"];
NSString *description = [snippet objectForKey:@"Description"];
NSString *html = [NSString stringWithFormat:@"<h3>%@</h3><p><a href='http://apple.com'><font color=\"gray\">%@</font>Test</a></p>", title, description];
[cell setHTMLString:html];
cell.attributedTextContextView.shouldDrawImages = YES;
}
任何指针都会很棒。