开发者

TTStyledTextLabel loading a web image inside a UITableViewCell

开发者 https://www.devze.com 2023-02-02 09:43 出处:网络
I have TTStyledTextLabel inside a UITableViewCell. The label loads a HTML string with references to web image resources. The problem I am facing is that once the image has been loaded the dimensions o

I have TTStyledTextLabel inside a UITableViewCell. The label loads a HTML string with references to web image resources. The problem I am facing is that once the image has been loaded the dimensions of the label need to be changed and hence the UITableViewCell.

Any idea as 开发者_JAVA百科to how this should be done.

Would appreciate any help. This has consumed a lot of my time.


Here is how I did it.

I scanned for all the text to see what images have to be downloaded. Once the images have been identified, i initiated their download using TTURLRequest. After the images were downloaded the sizeThatFits api returns the correct height.

This way is a bit slow, but solves the problem, until I am able to figure out a better way.

0

精彩评论

暂无评论...
验证码 换一张
取 消