您好,登錄后才能下訂單哦!
//將下載的圖片循環(huán)存入圖片的數(shù)組中
for ( int i = 0 ; i<count; i++)
{
//picarray為存放圖片路徑的數(shù)組
NSString * str = [picArray objectAtIndex:i];
NSURL * url_josna=[NSURL URLWithString:str];
NSURLRequest * request =[NSURLRequest requestWithURL:url_josna cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:10.0f];
//發(fā)送同步請求得到的數(shù)據(jù)
NSData * data=[NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
//self.p_w_picpath為屬性
self.p_w_picpath = [UIImage p_w_picpathWithData:data];
[p_w_picpathdataArray addObject:self.p_w_picpath];
}
//將圖片從數(shù)組取出循環(huán)貼在scroview上
for (int i = 0; i<count; i++)
{
NSLog(@"%d",i);
UIImageView * p_w_picpatha = [[UIImageView alloc] initWithFrame:CGRectMake(320*i, 0, 320, 480)];
[p_w_picpatha setImage:[p_w_picpathdataArray objectAtIndex:i]];
NSLog(@"%@",[p_w_picpathdataArray objectAtIndex:i]);
[scro addSubview:p_w_picpatha];
[p_w_picpatha release];
}
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。