它是一个应用程序,您可以在其中查看一系列图像(重叠)。
我使用ELCImagePicker,一个相机胶卷的扩展,它允许我们在相机胶卷中选择多个图像。
我在字典中得到返回的图像,如下所示:
for(NSDictionary *dict in info) {
UIImageView *thisImageView = [[UIImageView alloc] initWithImage:[dict objectForKey:UIImagePickerControllerOriginalImage]];
[array insertObject:thisImageView atIndex:[thearray count]];
[thisImageView release];
}
然后我推送一个视图控制器,它显示了正确的图像——它显示了我的 UIView 子类 SpinnerView
在 SpinnerView 中,我列出了子视图:
spinnerImages = [[NSMutableArray alloc] initWithArray:thearray];
for (UIView *object in spinnerImages) {
[object setContentMode:UIViewContentModeScaleAspectFit];
object.frame = self.frame;
[self addSubview:object];
}
当用户想要管理订单时,他们单击“编辑按钮”并获得一个modalViewController,它是AQGridView 库的一个实例,其工作方式类似于tableViewController,但有一些扩展。它就像一个跳板应用程序。当用户将图像“拖放”到新位置时,我会调用
[spinnerView exchangeSubviewAtIndex:_dragOriginIndex withSubviewAtIndex:index];
,就在表更新数组之后:
// update the data store
id obj = [[images objectAtIndex: _dragOriginIndex] retain];
[images removeObjectAtIndex: _dragOriginIndex];
[images insertObject: obj atIndex: index];
希望这有助于解决我的难题,让我摆脱头痛:)