Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 是否可以制作一个完全定制的UIImagePickerController?_Ios_Objective C_Xcode_Uinavigationcontroller_Uiimagepickercontroller - Fatal编程技术网

Ios 是否可以制作一个完全定制的UIImagePickerController?

Ios 是否可以制作一个完全定制的UIImagePickerController?,ios,objective-c,xcode,uinavigationcontroller,uiimagepickercontroller,Ios,Objective C,Xcode,Uinavigationcontroller,Uiimagepickercontroller,好的,我有一个UIImagePickerController。我希望它是全屏的,我想有一个导航控制器,我可以完全自定义。这可能吗?我试着制作自己的UINavigationController,推一个UIImagePickerController,导航栏隐藏,摄像头全屏显示,但显然苹果不允许这样做 任何帮助都将不胜感激。是的,这是我为您制作的: #pragma mark - Custom ImagePicker -(void) createCustonImagePicker {

好的,我有一个UIImagePickerController。我希望它是全屏的,我想有一个导航控制器,我可以完全自定义。这可能吗?我试着制作自己的UINavigationController,推一个UIImagePickerController,导航栏隐藏,摄像头全屏显示,但显然苹果不允许这样做


任何帮助都将不胜感激。

是的,这是我为您制作的:

   #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;



 }

可能是这个的复制品-是的,有可能。使用AssetLibrary.framework获取媒体列表,并在UICollectionView中显示它们。要显示相机,请使用AVFoundation.framework