自定义 iPhone 中的相机视图
提前致谢。 我想创建一个带有自定义相机视图的视图。像这样
要在一个视图控制器中执行此操作,我有创建了另一个视图控制器的实例,在第二个视图控制器中我正在创建 UIImagepickerController,如下所示:
-(void)showCamera
{
camController = [[UIImagePickerController alloc]init];
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
camController.sourceType = UIImagePickerControllerSourceTypeCamera;
}
camController.showsCameraControls = NO;
camController.navigationBarHidden = YES;
camController.toolbarHidden = YES;
camController.wantsFullScreenLayout = NO;
camController.cameraViewTransform = CGAffineTransformScale(camController.cameraViewTransform, 2.0f, 2.0f);
// Edited
//[self presentModalViewController:camController animated:YES];
}
在第一个视图控制器中:
cam = [[CamController alloc]init];
cam.view.frame = CGRectMake(5, 50, 310, 300) ;
[cam showCamera];
[self.view addSubview:cam.view];
//Edited
[self.cam presentModalViewController:self.cam.camController animated:NO];
[self performSelector:@selector(setFrame) withObject:self afterDelay:1.0];
[self.cam.camController.view setFrame:CGRectMake(10, 50, 300, 250)];
这实际上不起作用。是否是正确的流程。任何人都可以帮助我吗?
Thanks in advance.
I want to create a view with customizing camera view.Like this
To do this in one view controller I have created the instance of another view controller and in the second viewcontroller i am creating UIImagepickerController like this:
-(void)showCamera
{
camController = [[UIImagePickerController alloc]init];
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
camController.sourceType = UIImagePickerControllerSourceTypeCamera;
}
camController.showsCameraControls = NO;
camController.navigationBarHidden = YES;
camController.toolbarHidden = YES;
camController.wantsFullScreenLayout = NO;
camController.cameraViewTransform = CGAffineTransformScale(camController.cameraViewTransform, 2.0f, 2.0f);
// Edited
//[self presentModalViewController:camController animated:YES];
}
and in the first view controller :
cam = [[CamController alloc]init];
cam.view.frame = CGRectMake(5, 50, 310, 300) ;
[cam showCamera];
[self.view addSubview:cam.view];
//Edited
[self.cam presentModalViewController:self.cam.camController animated:NO];
[self performSelector:@selector(setFrame) withObject:self afterDelay:1.0];
[self.cam.camController.view setFrame:CGRectMake(10, 50, 300, 250)];
This is not working actually. Is it correct process. Can any one help me .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Sandhya 中,UIImagePickerController 有一个内置函数,通过名为cameraOverlayView 的属性实现此目的。
您可以分配视图,然后拥有
Shai。
sandhya , UIImagePickerController has has a built in function for this by the property called cameraOverlayView.
You could alloc the view and then have
Shai.