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];
}
iPhone中的圖像加載問題? - 來自webservice
我已經將圖像載入
imgBiteSpot
。 圖像從web服務加載。問題是它需要太多時間(35秒到1分鐘)。
如果我刪除圖像 - >代碼/加載,反應時間僅爲0.2秒。
減少圖像加載過程的時間的解決方案是什麼?
在此先感謝您的幫助。