0

我正在开发一个应用程序。我正在使用. 那UIImagePickerController一个将在整个屏幕上打开。但我需要在 . 中间打开那个选择器screen(50,50,220,380)。所以请告诉 mw 我该怎么做这个。

4

1 回答 1

0

I ended up with a lovely miniature camera imagePicker floating in the middle of my screen using the following

 UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];

imagePickerController.delegate = self;
//  imagePickerController.mediaTypes = [NSArray arrayWithObjects:(NSString *)kUTTypeImage, nil];
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
// imagePickerController.cameraCaptureMode = UIImagePickerControllerSourceTypePhotoLibrary;

UIView *controllerView = imagePickerController.view;

controllerView.alpha = 0.0;
controllerView.transform = CGAffineTransformMakeScale(0.5, 0.5);

[[[[UIApplication sharedApplication] delegate] window] addSubview:controllerView];

[UIView animateWithDuration:0.3
                      delay:0.0
                    options:UIViewAnimationOptionCurveLinear
                 animations:^{
                     controllerView.alpha = 1.0;
                 }
                 completion:nil
 ];
于 2012-09-26T11:31:51.777 回答