How to implement a gallery of images inside the application, simulating the default gallery of the iPhone?

I want to implement an image gallery inside my iPhone application, which will have only those images from the device gallery that were either selected from the inside of the application, or pictures taken inside the application. Please consult with any simple ways.

+4
source share
3 answers

You can try Three20 , this is a very good basis for such a task.

Here is an example of code that you can use.

In the interface:

//IBOutlet UIImageView *image; UIImagePickerController *imgPicker; IBOutlet UIImageView *imageview; 

Then in viewDidLoad:

 self.imgPicker = [[UIImagePickerController alloc] init]; self.imgPicker.allowsImageEditing = YES; //self.imgPicker.delegate = self; self.imgPicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; //imgarry = [[NSArray alloc]initWithObjects:@"terms.png",@"change-profile.png",nil]; UIImage* img = [UIImage imageNamed:@""]; UIImageWriteToSavedPhotosAlbum(img,nil,nil,nil); 

Then in buttonClick:

 UIImagePickerController *picker = [[UIImagePickerController alloc]init]; imgPicker.delegate = self; imgPicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; [self presentModalViewController:imgPicker animated:YES]; [imgPicker release]; 

Here's how I do it, remember to install @property and @synthesis to view images and UIImagePicker.

+4
source
+2
source

You can use UIScrollView with paging = YES.

-1
source

All Articles