0

Okay, so I have a UIImagePickerControler. I want it to be full screen and I want to have a navigation controller that I can completely customize. Is this possible? I tried making my own UINavigationController and pushing a UIImagePickerController with the navigation bar hidden and the camera full screen, but apparently Apple does not allow this.

Any assistance would be appreciated.

Benr783
  • 2,860
  • 4
  • 20
  • 28
  • Probably a duplicate of this - http://stackoverflow.com/questions/15865368/how-to-create-a-custom-uiimagepickercontroller-with-full-screen-images-ios – taylorcressy Nov 11 '14 at 15:50
  • Yes, it's possible. Get media list with `AssetsLibrary.framework` and display them in `UICollectionView`. To display camera use `AVFoundation.framework` – Cy-4AH Nov 11 '14 at 15:56

1 Answers1

0

Yes, Here you are one I made:

   #pragma mark - Custom ImagePicker
   -(void) createCustonImagePicker
  {

self.imagePickerController = [[UIImagePickerController alloc] init];
self.imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
self.imagePickerController.showsCameraControls = NO;



CGFloat height = [UIScreen mainScreen].bounds.size.height;
UIView *newView = [[UIView alloc] initWithFrame:CGRectMake(0, 0,      self.imagePickerController.view.bounds.size.width, self.imagePickerController.view.bounds.size.height)];
UIView *downBack;

if (height == 480) {
    // Configure to iPhone 4 -4s
    UIView *upBack = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 35)];
    upBack.backgroundColor = [UIColor blackColor];
    [newView addSubview:upBack];
    downBack = [[UIView alloc] initWithFrame:CGRectMake(0, 355, 320, 125)];
    downBack.backgroundColor = [UIColor blackColor];
    [newView addSubview:downBack];

    UIButton *flashButton = [[ UIButton alloc] initWithFrame:CGRectMake(15, 7, 120, 20)];
    // Configure your own flash button
    [upBack addSubview:flashButton];

    UIImageView *icono = [[UIImageView alloc] initWithFrame:CGRectMake(5, 12, 22, 22)];
    icono.image = [UIImage imageNamed:@"dotred"];
    [downBack addSubview:icono];

    UILabel *text = [[UILabel alloc] initWithFrame:CGRectMake(40, 2.5, 280, 40)];
    text.font = // Here your font;
    text.textColor = [UIColor whiteColor];
    text.text = NSLocalizedString(@"Here is and example to see", nil);
    text.numberOfLines = 2;
    [downBack addSubview:text];

    UIButton *cancel = [[UIButton alloc] initWithFrame:CGRectMake(230, 7, 70, 20)];
    // cancel.titleLabel.font = MAIN_FONT;
    cancel.titleLabel.textAlignment = NSTextAlignmentRight;
    cancel.titleLabel.textColor = [UIColor whiteColor];
    [cancel setTitle:NSLocalizedString(@"Cancel", nil) forState:UIControlStateNormal];
    [cancel addTarget:self action:@selector(cancelButton:) forControlEvents:UIControlEventTouchUpInside];
    [newView addSubview:cancel];


} else {
    UIView *upBack = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 80)];
    upBack.backgroundColor = [UIColor blackColor];
    [newView addSubview:upBack];
    downBack = [[UIView alloc] initWithFrame:CGRectMake(0, 400, 320, 168)];
    downBack.backgroundColor = [UIColor blackColor];
    [newView addSubview:downBack];

    UIButton *flashButton = [[ UIButton alloc] initWithFrame:CGRectMake(15, 27, 120, 20)];

    [upBack addSubview:flashButton];

    UIImageView *icono = [[UIImageView alloc] initWithFrame:CGRectMake(10, 22, 22, 22)];
    icono.image = [UIImage imageNamed:@"dotred"];
    [downBack addSubview:icono];

    UILabel *text = [[UILabel alloc] initWithFrame:CGRectMake(40, 12.5, 280, 40)];
    text.font =You font;
    text.textColor = [UIColor whiteColor];
    text.text = NSLocalizedString(@"Example the\ntext, nil);
    text.numberOfLines = 2;
    [downBack addSubview:text];

    UIButton *cancel = [[UIButton alloc] initWithFrame:CGRectMake(230, 27, 70, 20)];
    // cancel.titleLabel.font = MAIN_FONT;
    cancel.titleLabel.textColor = [UIColor whiteColor];
            cancel.titleLabel.textAlignment = NSTextAlignmentRight;
    [cancel setTitle:NSLocalizedString(@"Cancel", nil) forState:UIControlStateNormal];
    [cancel addTarget:self action:@selector(cancelButton:) forControlEvents:UIControlEventTouchUpInside];
    [newView addSubview:cancel];
}


   self.takePhotoButton = [[UIButton alloc] initWithFrame:CGRectMake(123, height -80, 73, 73)];
   [self.takePhotoButton setImage:[UIImage imageNamed:@"cambuttonred"] forState:UIControlStateNormal];
    [self.takePhotoButton setImage:[UIImage imageNamed:@"cambuttonblack"] forState:UIControlStateHighlighted];
   [newView addSubview:self.takePhotoButton];
    [self.takePhotoButton addTarget:self action:@selector(takeTakMainPhoto) forControlEvents:UIControlEventTouchUpInside];
   self.takePhotoButton.hidden = YES;

[newView addSubview:self.isReadyLabel];
self.imagePickerController.cameraOverlayView = newView;
if (height == 480) {
self.imagePickerController.cameraViewTransform = CGAffineTransformMake(1.0, 0.0, 0.0,1.0, 0.0, 35);
} else {
self.imagePickerController.cameraViewTransform = CGAffineTransformMake(1.0, 0.0, 0.0,1.0, 0.0, 80);
}

self.imagePickerController.delegate = self;



 }
Onik IV
  • 5,007
  • 2
  • 18
  • 23