you are just the first to create a new representation of the runtime and the image and assign a tag of all kinds, for example 1000 or 100, and increase the value of the tag, and then add this view to the scroll and two buttons to move left and right and do their actions on the output and add all scrollview routines in to mutable array like this
indexStart=100; UIView *AddView=[[UIView alloc]initWithFrame:CGRectMake(55, 0, 100, 100)]; AddView.tag=indexStart; btnTap.tag=indexStart; UIImageView *imgview=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)]; [AddView addSubview:imgview]; imgview.image=image; imgview.tag=1000; [ScrollView addSubview:AddView]; [imgArray addObject:AddView];
you use a loop for this, and on the left and right buttons you use this code, and in this code editImgeView is a representation of the image between the left and right buttons, where you display the image, just a simple indexstart ++ or - if the user selects the right or left button
for (int index = 0; index < [imgAddArrayAfter count]; index ++ ) { NSLog(@"index %d",index); UIView *vc=[imgArray objectAtIndex:index]; NSLog(@"view tag %d",vc.tag); if(vc.tag == indexStart) { UIImageView *modalView=(UIImageView *) [vc viewWithTag:1000]; editImgeView.image=modalView.image; } }
I hope you understand; -)
source share