简体   繁体   English

您如何通过Parse.com查找1张以上的图像

[英]How do you segue more than 1 image referring Parse.com

Following this Question/Answer 遵循此问题/答案

https://www.parse.com/questions/pfquerytableviewcontroller-segue https://www.parse.com/questions/pfquerytableviewcontroller-segue

I would like to know how do you set the code on passing more than 1 image. 我想知道您如何设置传递超过1张图像的代码。 Is there a way to make the UIImageView Reusable? 有没有一种方法可以使UIImageView可重用? (Like a CollectionView Cell) (就像CollectionView单元格一样)

This would be the code to follow for 1 Image coming from the cell clicked. 这将是来自所单击的单元格的1张图像所遵循的代码。

EDITED CODE: 编辑代码:

-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {

static NSString *cellIdentifier = @"Cell";
VestimentaDetailCell *cell = (VestimentaDetailCell *) [collectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath];

static int index = 1;

PFFile *imageFile = [self.vestimenta objectForKey: [NSString stringWithFormat:@"image_%d", index++]];

[imageFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
if (!error) {

cell.imageFile.image = [UIImage imageWithData:data];


}
}];

return cell;
}

How can I make the cell reusable and show more images? 如何使单元可重复使用并显示更多图像?

Thank you. 谢谢。

It sounds like you're asking if you can change the image that's installed in an image view once it's been created? 听起来好像您在询问是否可以在创建图像后更改安装在图像视图中的图像? If so, the answer is most definitely yes. 如果是这样,答案肯定是肯定的。

You can replace the image in an image view as many times as you want. 您可以根据需要多次替换图像视图中的图像。 The same goes for the images loaded into buttons, but you have to use a special method for that. 加载到按钮中的图像也是如此,但是您必须使用一种特殊的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM