Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在iOS 7上将图片从URL显示到UICollectionView_Ios_Ios7 - Fatal编程技术网

在iOS 7上将图片从URL显示到UICollectionView

在iOS 7上将图片从URL显示到UICollectionView,ios,ios7,Ios,Ios7,如何将URL上的照片显示到UICollectionView中,并对照片进行分页,请提供帮助 NSString *MyPatternString=[self.PatternImages objectAtIndex:indexPath.row]; cell.PattImagCollection.image=[UIImage imageNamed:MyPatternString ]; 您可以尝试以下方法: UIImage *image = [UIImage imageWithData:[NSData

如何将URL上的照片显示到UICollectionView中,并对照片进行分页,请提供帮助

NSString *MyPatternString=[self.PatternImages objectAtIndex:indexPath.row];
cell.PattImagCollection.image=[UIImage imageNamed:MyPatternString ];
您可以尝试以下方法:

UIImage *image = [UIImage imageWithData:[NSData
    dataWithContentsOfURL:[NSURL URLWithString:YourURL]]];

cell.yourimageviewname.image=图像

您需要向我们提供更多信息,比如MyPatternString中的内容。此外,在Objective-C中,变量和属性不应以大写字母开头。所以MyPatternString应该是MyPatternString。PatternImages和PattImagCollection也是如此。ok@rckoenes这是我的代码。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。{self.urlAddress=@;self.PatternImages=@[@010.jpg,@011.jpg];},我正在使用我的计算机上保存在数组PatternImages上的图片,因此,现在我需要另一种方法从URL获取图片,并以相同的方式显示在UICollection视图上……我所说的PattImagCollection是指集合视图单元格上的UIImageView。ImageName:仅从应用程序包或资产文件加载图像。您需要编写代码从web加载图像。使用Google有很多关于这个.assets文件的例子,是的,这就是我需要加载图像并显示在uicollectionview上的内容。