我已經做了一個小圖像,並在其中一個詳細頁面。 和我在詳細頁面我有一個圖像標籤是在webview
html頁面。 這是完全工作,但圖像需要花費很多時間來加載和顯示在屏幕上。 那麼如何減少加載圖像的時間。並且這個圖像來自url。iphone image loading問題
1
A
回答
1
imgBiteSpot.clipsToBounds=YES;
NSData *imageData = [[[NSData alloc]init]autorelease];
imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:ObjBitSpot.StrImagePath]];
if(imageData==0)
{
imgBiteSpot.image=[UIImage imageNamed:@"img-not-found.gif"];
}
else {
UIImage *imgs = [[UIImage alloc] initWithData:imageData];
UIGraphicsBeginImageContext(CGSizeMake(88,88));
[imgs drawInRect:CGRectMake(0.0, 0.0, 88.0, 88.0)];
UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
imgBiteSpot.image=newImage;
[imgs release];
}
0
0
其採取的圖像尺寸和上網速度的時間基準。
但是你可以在你的應用程序中做一件事。
您可以異步下載該映像並將其存儲在臨時變量中,然後再進入詳細圖像視圖。當你進入這個細節圖像時,你可以根據你的需求加載下載的圖像。
1
您可以考慮不下載圖像,但從Web服務下載一個字符變量/標誌。根據Web服務的答案,您可以從包中本地加載圖像?這可能會更快。
Chris。
相關問題
- 1. iphone - image loading
- 2. iPhone image問題
- 3. Properties.Resources not loading image
- 4. wordpress image loading
- 5. Lazy loading image listView
- 6. jQuery Ajax Loading Image Hang
- 7. Iframe Loading image和IE
- 8. iOS:tab item image not loading
- 9. javascript to display loading image
- 10. Reactjs local image not loading
- 11. Loading Image in P5.js
- 12. java - Swing image not loading
- 13. Azure Blob Image Loading Sideways
- 14. Add A Loading Image to Website
- 15. Gh-Pages loading問題
- 16. loading TinyMCE的問題
- 17. iPhone Image Loading在照片中應用程序
- 18. javascript image問題
- 19. iphone uiimage not loading
- 20. javascript html url loading問題
- 21. MediaElement.js問題卡在Loading
- 22. PHP GD Image問題
- 23. Jquery Image Rotator問題
- 24. CSS background image問題
- 25. Image Slider JavaScript問題
- 26. javascript image rotator問題
- 27. .xib not loading right(iPhone)
- 28. image not loading使用json from url
- 29. UITextView BackGround image iphone
- 30. iPhone Splash Image
你忘了在你的問題中發佈一些代碼..幫助我們幫助你! – Saurabh 2011-04-25 08:10:11