UIImagePickerController Mehrere Bilder auswählen

Ich versuche einfach, die Auswahl mehrerer Bilder aus der Fotobibliothek mit dem UIImagePickerController zu aktivieren. Ich wünschte, ich könnte eine Unteransicht unten in der Fotoauswahl hinzufügen, damit sie so aussieht wie in der folgenden App:

Kannst du es auf einfache Weise tun? In meinem Code werden die Bilder derzeit nur auf standardmäßige Weise angezeigt, aber ich entlasse den Controller nur, wenn 6 Bilder geladen sind

Das Wichtigste ist, dass ich, wenn ich trotzdem eine kleine Ansicht / Symbolleiste zur Fotoauswahlansicht hinzufügen kann, wie im Beispiel, dann kann ich den Rest erledigen

    - (void)getMediaFromSource:(UIImagePickerControllerSourceType)sourceType{
      //get all available source types
      NSArray *mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:sourceType];

      //if source type available and supported media type is not null
      if ([UIImagePickerController isSourceTypeAvailable:sourceType
           && [mediaTypes count] > 0]) {

        UIImagePickerController *picker = [[UIImagePickerController alloc] init];
        //picker.mediaTypes = mediaTypes;   //allow videos
        picker.delegate = self;
        picker.sourceType = sourceType; //set source type to the given type

        /** WANT TO ADD A CUSTOM VIEW IN THE PHOTO PICKER VIEW **/

        [self presentViewController:picker animated:YES completion:nil];
      } else {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error accessing media"
                                                        message:@"Device doesn't support that media type"
                                                       delegate:nil
                                              cancelButtonTitle:@"Drat !"
                                              otherButtonTitles: nil];
        [alert show];
      }
    }

    - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
      self.lastChosenMediaType = [info objectForKey:UIImagePickerControllerMediaType];  //record media type

      //if media type is image
      if ([lastChosenMediaType isEqual:(NSString *) kUTTypeImage]) {
        UIImage *chosenImage = [info objectForKey:UIImagePickerControllerOriginalImage];    //load image

        //save the image if is from camera shot
        if (imageOrVideoSourceType == UIImagePickerControllerSourceTypeCamera) {
          UIImageWriteToSavedPhotosAlbum (chosenImage, nil, nil , nil);
        }

        [images addObject:chosenImage]; //add to image list
        imageNum++;
      }

      changeImageOrVideo = true;

      if(imageNum >= 5){
          [picker dismissViewControllerAnimated:YES completion:nil];
      }
    }

Antworten auf die Frage(1)

Ihre Antwort auf die Frage