Ios5 仅在屏幕的一半上显示摄像头

Ios5 仅在屏幕的一半上显示摄像头,ios5,camera,Ios5,Camera,我想在iPhone和iPad上只显示一半屏幕的摄像头视图。我做了很多搜索,但还没有找到解决方案。试试这个。。如果这对你没有帮助或面临任何问题,请告诉我,我将为你提供其他一些示例代码 UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.delegate = self; imagePickerController.mediaTyp

我想在iPhone和iPad上只显示一半屏幕的摄像头视图。我做了很多搜索,但还没有找到解决方案。

试试这个。。如果这对你没有帮助或面临任何问题,请告诉我,我将为你提供其他一些示例代码

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

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

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

[imagePickerController release];

这没什么大不了的首先告诉我。。。你在为iPhone或iPad编写代码吗?在剩下的部分你需要什么?在屏幕的一半添加一个摄像头覆盖。按照本教程添加摄像头覆盖。你可以添加按钮、背景、图像或其他任何内容作为覆盖。我已经为iPhone和iPad创建了通用应用程序both@annu-我想再吃一半标签和文本框见此链接