嗨,我創建了一個TTStyledTextLabel,效果很好。TTStyledText中的URL和圖像
現在我想使URL點擊,我已經做到了這一點:
textLabel.text = [TTStyledText textFromXHTML:[content objectForKey:@"content"] lineBreaks:YES URLs:YES];
,但我的鏈接仍然無法點擊。我必須先設置一個UIWebView嗎?在哪裏申報?
另一件事是,是否可以調整我的TTStyledTextLabel中的圖片大小以適應他們的標籤大小?
在此先感謝
//編輯
什麼我有完全做到:
textLabel = [[TTStyledTextLabel alloc] initWithFrame:CGRectMake(0.0f, 70.0f, 320.0f, 297.0f)];
textLabel.contentInset = UIEdgeInsetsMake(20, 15, 20, 15);
textLabel.font = [UIFont systemFontOfSize:14];
textLabel.text = [TTStyledText textFromXHTML:[content objectForKey:@"content"] lineBreaks:YES URLs:YES];
[textLabel sizeToFit];
//CGFloat height = textLabel.height;
[scrollView addSubview:textLabel];
scrollView.contentSize = textLabel.frame.size;
一個的NSLog我[content objectForKey:@"content"]
回報是這樣的:
<a href="http://www.abc.com/">Download-Link</a>
我的鏈接在我的標籤中突出顯示,但它們無法點擊。
我初始化我爲textLabel在- (void)viewDidLoad
在一個UIViewController
沒人?我必須寫的任何事情,我的文字是更好理解? – choise 2010-02-17 10:55:54