简体   繁体   English

如何在不移动使用照片和在iOS中重拍的情况下应用相机功能?

[英]How to apply camera feature without moving to use photo and retake in iOS?

I stuck to apply square focus in UIImage picker controller and how to stay on camera page without moving to another page same like below screen. 我坚持在UIImage picker控制器中应用方形焦点,以及如何保持在相机页面上而不移动到屏幕下方的其他页面。 please help me. 请帮我。 I tried to implement in custom overlay for this but in square focus not coming. 我尝试为此实现自定义叠加层,但没有重点关注。 在此处输入图片说明

在我的UIImagePickerController中,首先不显示正方形,但是当我点击屏幕时,正方形会显示出来。

自动对焦图像

download the above image(ask your designer to give you better image) and add to your project. 下载以上图片(请让您的设计师为您提供更好的图片)并添加到您的项目中。

add this code while creating imagepicker 在创建图像选择器时添加此代码

 UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(createAutoFocus)];
                [overlayView addGestureRecognizer:tap];//overlayview is your custom overlay

then add this method in your class 然后在您的课程中添加此方法

-(void)createAutoFocus{

    // NSLog(@"click");
 CGPoint touchPoint=[recognizer locationInView:overlayView];//overlayview is your custom overlay
    // NSLog(@"%@", NSStringFromCGPoint(touchPoint));
    UIImageView *imgViewFocus = [[UIImageView alloc] initWithFrame:CGRectMake(touchPoint.x, touchPoint.y, 80, 80)];
    imgViewFocus.image = [UIImage imageNamed:@"focus.png"];
    imgViewFocus.alpha = 0.8;
    [overlayView addSubview:imgViewFocus];
    [imagePickerCustom setCameraOverlayView:overlayView];//your customimagepicker
    [imgViewFocus performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0.5];

}

Let me know if you have any issues. 如果您有任何问题,请告诉我。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从相机拍摄照片后如何跳过“重新使用”选项 - How to skip 'retake and use' option after captureing photo from camera 相机“重拍”和“使用照片”按钮不起作用 - Camera " Retake " and " Use photo " buttons not working 带有覆盖的iOS 7 UIImagePickerController - 重新拍摄并使用不可用的照片 - iOS 7 UIImagePickerController with Overlay - retake and use photo not usable 在iOS应用中拍照后是否可以避免“使用”/“重拍”屏幕? - Is it possible to avoid the “use”/“retake” screen after taking a photo in an iOS app? UIImagePickerController在UpperCase Letters“USE_PHOTO”,“RETAKE”和Gallery Images“CAMERA_ROLL”中显示文本? - UIImagePickerController shows text in UpperCase Letters “USE_PHOTO” , “RETAKE” and Gallery Images “CAMERA_ROLL”? Swift:如何更改UIImagePickerController的“使用照片”,“取消”,“拍摄”,“重拍”按钮的默认行为 - Swift: how to change default behaviour of buttons “Use Photo”, “Cancel”, “Shoot”, “Retake” of UIImagePickerController iOS没有modalViewController从相机拍照 - iOS take photo from camera without modalViewController 在 iOS 中拍摄没有相机视图的照片 - Capture photo without camera view in iOS 如何在Img.ly iOS SDK中将自定义滤镜应用于相机和照片视图? XCode 8.1 Swift 3.0.1 - How to Apply Custom Filter to Camera & Photo View in Img.ly iOS SDK? XCode 8.1 Swift 3.0.1 UIImagePickerController 使用照片/重拍按钮不起作用 - UIImagePickerController Use Photo / Retake buttons don't work
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM