禁用 iPhone 中的图像选择器默认动画

发布于 2024-10-21 11:43:32 字数 1223 浏览 1 评论 0原文

你好 我有以下代码,可以拉起相机并在相机的视图上添加叠加层。在相机出现之前,有一个动画。有没有办法可以删除动画并立即跳转到叠加视图?

//create an overlay view instance
    OverlayView *overlay = [[OverlayView alloc]
                            initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGTH)];

    //create a new image picker instance
    UIImagePickerController *picker = 
    [[UIImagePickerController alloc] init];
    //set source to video!
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    //[picker startVideoCapture];

    //picker. = 1;
    //hide all controls
    picker.showsCameraControls = NO;
    picker.navigationBarHidden = YES;
    picker.toolbarHidden = YES;
    //make the video preview full size
    picker.wantsFullScreenLayout = YES;
    picker.cameraViewTransform =
    CGAffineTransformScale(picker.cameraViewTransform,
                           CAMERA_TRANSFORM_X,
                           CAMERA_TRANSFORM_Y);
    //set our custom overlay view
    picker.cameraOverlayView = overlay;
    picker.allowsEditing = NO;

    //show picker
    //[self.view insertSubview:picker.view atIndex:0];  
    [self presentModalViewController:picker animated:NO];   
    [self.view bringSubviewToFront:overlay];

Hi
I have the following code which pulls up the camera and add an overlay on the camera's view. Before the camera shows up, there is an animation. Is there a way that can remove the animation and jumps to the overlay view right away?

//create an overlay view instance
    OverlayView *overlay = [[OverlayView alloc]
                            initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGTH)];

    //create a new image picker instance
    UIImagePickerController *picker = 
    [[UIImagePickerController alloc] init];
    //set source to video!
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    //[picker startVideoCapture];

    //picker. = 1;
    //hide all controls
    picker.showsCameraControls = NO;
    picker.navigationBarHidden = YES;
    picker.toolbarHidden = YES;
    //make the video preview full size
    picker.wantsFullScreenLayout = YES;
    picker.cameraViewTransform =
    CGAffineTransformScale(picker.cameraViewTransform,
                           CAMERA_TRANSFORM_X,
                           CAMERA_TRANSFORM_Y);
    //set our custom overlay view
    picker.cameraOverlayView = overlay;
    picker.allowsEditing = NO;

    //show picker
    //[self.view insertSubview:picker.view atIndex:0];  
    [self presentModalViewController:picker animated:NO];   
    [self.view bringSubviewToFront:overlay];

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文