开发者

How to insert image in xml on iphone

开发者 https://www.devze.com 2023-01-06 18:28 出处:网络
In my app i insert images in the tableview by putting the url of image in the field image ofxml!! It\'s possible insert the entire image directly in XML, including in the field im开发者_JAVA技巧age, i

In my app i insert images in the tableview by putting the url of image in the field image of xml!! It's possible insert the entire image directly in XML, including in the field im开发者_JAVA技巧age, instead of the URL, a kind of image compression, for example, the bits that make up the image.


This will increase the loading time a lot!

Search for a solution for "lazy loading" on the Web.

This is the most common approach for loading images in the table views on iPhone...


EDIT:
If you still want to use blub (image data as text inside the XML) then you might use the next code sample:

NSData *imageData = [NSData dataWithBase64EncodedString:imageString];
UIImage *image = [UIImage imageWithData:imageData];
0

精彩评论

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