最佳答案
我猜你的表数组应该是这样的:
[
{
price : "$ 000",
adress : "adress",
size : "size",
imagesArray : [
{
imageName : "name",
image : "image"
}
]
}
]
在表格 View 单元格中使用 Collection View ,并为 Collection View 启用分页。将图像数组传递给 Collection View
或
如果仅在表格 View 单元格中使用 ImageView ,则应保持图像的位置。因此,只需创建一个可变的位置数组,其中表数组计数像表数组一样作为 3 个值,位置数组应该像 [0,0,0]。最初,第 0 个索引将是可见的。所以给定的值为 0。
在cellForIndex方法中:
NSArray * imageArray =[NSArray new];
imageArray = [[tableArray objectAtIndex:indexPath.row] valueForKey:@"imagesArray"]
NSInteger imageIndex = [positionArray objectAtIndex: indexPath.row];
cell.imageView.image = [imageArray objectAtindex:imageIndex] valueForKey:@"image"]
将indexpath设置为箭头按钮的标签。
如果您在 TableView 的第一个索引中单击右箭头,在目标方法中,从标签获取索引并增加位置数组的第一个索引值处的值。现在重新加载 TableView 或特定单元格。
关于ios - 在 Tableviewcell 中显示多个图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43744418/