我在我的CustomCell中为我的UITableView添加了一个TTStyledTextLabel,代码是:
TTStyledTextLabel * tt_title = [[[TTStyledTextLabel alloc] initWithFrame:CGRectMake(50, cell.frame.origin.y, 640, 200)] autorelease];
tt_title.text = [TTStyledText textWithURLs:[[self.posts objectAtIndex:indexPath.row] message]];
tt_title.font = [UIFont systemFontOfSize:15];
tt_title.contentInset = UIEdgeInsetsMake(10, 10, 10, 10);
[tt_title sizeToFit];
[cell addSubview:tt_title];
传入的NSString有一个URL,但是当我单击这个URL时,它没有做任何事情。甚至在野生动物园里都不能打开它..为什么会这样呢?
发布于 2011-05-26 06:55:44
如果看不到传递给TTStyledText的实际字符串中的内容,就不能确切地确定,但是作为替代方法,您可以尝试使用
[TTStyledText textFromXHTML:[[self.posts objectAtIndex:indexPath.row] message] lineBreaks:NO URLs:YES];并将<a href=''></a>添加到字符串中
https://stackoverflow.com/questions/6127634
复制相似问题