I am new to i phone programming.How to select and deselect the thumbnail images.Right now what i did i have taken custom button using that i am adding custom image to thumbnails,it is mainly used for i can know that these thumbnail images are selected.like that,if select any thumbnail image means,custom button is attaching to each every selected thumbnail image.
Now what i want means if i again click on same image means i want remove custom button image form the selected thumbnail.again if i selected means it have attach that custom button image and if again select on same image means i have remove that custom button image form the thumbnail.Can any body tell what logic i have use here.
Here is my code
- (void)handleThumbClick:(id)sender
{
NSLog(@"yes selected");
FGalleryPhotoView *photoView = (FGalleryPhotoView*)[(UIButton*)sender superview];
customBadge1 = [CustomBadge customBadgeWithString:@"1"
withStringColor:[UIColor greenColor]
withInsetColor:[UIColor redColor]
withBadgeFrame:YES
withBadgeFrameColor:[UIColor grayColor]
withScale:1.0
withShining:YES];
b =[UIButton buttonWithType:UIButtonTypeCustom];
b.frame = CGRectMake(0,0, 100,100);
[b setImage:[UIImage imageNamed:@"Overlay@2x.png"] forState:UIControlStateNormal];
[b setTitle:@"1" forState:UIControlStateNormal];
// [b setTag:4];
NSLog(@"Thumb click Fgallerview controller");
[photoView addSubview:b];
[photoView addSubview:customBadge1];
}
The above code for if click on any thumbnail means its attaching the custom button image to that thumbnail image.Now what i want means if again if click on same thumbnail i have remove that custom thumbnail image.
For example in thumbnail view i have 10 images is displaying now i want to select only 5 images if click on any 5 thumbnail means its attaching custom button image to 5 selected images.Now what i want means if want in selected 5 thumbnail images having custom button image.now if i select any selected image means i have to uncheck that selected image ,means i want to remove that custom button image form the selected thumbnail.
Can any body tell me how to do this
And one more thing i now that by using ELCimagepickercontroller we can able to select multiple images,but that only gallery images but here i am displaying from private document directory folder images..Please help meee
Thanks
Aslam
Set thumbnail image as
setBackgroundImageand set initial tag=0;