[英]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.