Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.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 在Tableviewcell中显示多个图像_Ios_Objective C_Uitableview_Imageview_Tableviewcell - Fatal编程技术网

Ios 在Tableviewcell中显示多个图像

Ios 在Tableviewcell中显示多个图像,ios,objective-c,uitableview,imageview,tableviewcell,Ios,Objective C,Uitableview,Imageview,Tableviewcell,如何在单击“前进”和“后退”按钮时在单个单元格中显示多个图像,如下图所示 我猜您的表数组将如下所示: [ { price : "$ 000", adress : "adress", size : "size", imagesArray : [ { imageName : "name",

如何在单击“前进”和“后退”按钮时在单个单元格中显示多个图像,如下图所示


我猜您的表数组将如下所示:

[
    {
        price   : "$ 000",
        adress  : "adress",
        size    : "size",
        imagesArray : [
                    {
                        imageName : "name",
                        image  : "image"
                    }
                  ]
    }
]
在表格视图单元格中使用集合视图,并为集合视图启用分页。将图像数组传递到集合视图

若仅在表格视图单元格中使用图像视图,则应保持图像的位置。因此,只需创建一个可变的位置数组,其中表数组count like table array为3个值,位置数组应该类似于[0,0,0]。最初,第0个索引将可见。所以给定的值是0

单元索引中方法:

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设置为箭头按钮的标记


若在表视图的第一个索引中单击右箭头,则在目标方法中,从标记中获取索引,并增加位置数组的第一个索引值处的值。现在重新加载表视图或特定单元格。

我猜您的表数组将如下所示:

[
    {
        price   : "$ 000",
        adress  : "adress",
        size    : "size",
        imagesArray : [
                    {
                        imageName : "name",
                        image  : "image"
                    }
                  ]
    }
]
在表格视图单元格中使用集合视图,并为集合视图启用分页。将图像数组传递到集合视图

若仅在表格视图单元格中使用图像视图,则应保持图像的位置。因此,只需创建一个可变的位置数组,其中表数组count like table array为3个值,位置数组应该类似于[0,0,0]。最初,第0个索引将可见。所以给定的值是0

单元索引中方法:

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设置为箭头按钮的标记


若在表视图的第一个索引中单击右箭头,则在目标方法中,从标记中获取索引,并增加位置数组的第一个索引值处的值。现在重新加载表格视图或特定单元格。

单击按钮是否替换图像?您只需要一个自定义tablecellview和一些基本的objective c知识使用自定义tableview单元格。@Pat_Morita如何在单击该图像时获得弹出窗口在自定义单元格中添加带分页的滚动视图。请参阅打开popover,或者使用故事板和popover segue,或者实例化您自己的popoverViewControllerReplace按钮上的图像单击?您只需要一个自定义tablecellview和一些基本的objective c知识使用自定义tableview单元格。@Pat_Morita如何在单击该图像时获得弹出窗口在自定义单元格中添加带分页的滚动视图。请参阅打开popover,或者使用故事板和popover segue,或者实例化您自己的popoverViewController