简体   繁体   English

Flash无法在具有iOS 11.2.2的iPhone 6S中运行

[英]Flash is Not Working in iPhone 6S with iOS 11.2.2

When I'm running the app in iPhone 6S with iOS 11.2.2. 当我在带有iOS 11.2.2的iPhone 6S中运行该应用程序时。 The Flash is not working. 闪光灯无法正常工作。 Toggle button is working fine ie, On/Off. 切换按钮工作正常,即开/关。 But, Flash is not coming when the toggle is On. 但是,当切换开关打开时,Flash不会出现。

- (void)toggleFlash{
        NSArray *devices = [AVCaptureDevice devices];
        for (AVCaptureDevice *device in devices){
            if (device.flashAvailable) {
                if (flashOn){
                    [device lockForConfiguration:nil];
                    [device isTorchModeSupported:AVCaptureTorchModeOn];
                    [device unlockForConfiguration];
                }
                else{
                    [device lockForConfiguration:nil];
                    [device isTorchModeSupported:AVCaptureTorchModeOff];
                    [device unlockForConfiguration];
                }
            }
        }
    }

Done with the debugging.. It's working fine. 完成调试工作。 But, Issue with Flash. 但是,Flash问题。 Anyone Working on this issue. 解决此问题的任何人。 Please help me out? 请帮帮我吗?

Your code only checks whether torch mode is available ( isTorchModeSupported ) but never turns on the torch. 您的代码仅检查割炬模式是否可用( isTorchModeSupported ),而不会打开割炬。 You can use setTorchModeOn for that, 您可以setTorchModeOn使用setTorchModeOn

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

相关问题 iOS 9 Spritekit双击不适用于iPhone 6S - iOS 9 Spritekit Double Tap Not Working on iPhone 6S 无法在iOS Safari上播放视频-iPhone 6s - Video not playing on iOS Safari - iphone 6s 自动版式无法在iPhone 6s Plus中正常运行 - Autolayouts not working as expected in iPhone 6s Plus Touchable Opacity 不适用于 iPhone 6、6s、8,但适用于 iPhone 11 - Touchable Opacity not working with iPhone 6,6s,8 but working with iPhone 11 iPhone 6s - iOS 9.1在[UICollectionViewController previewingContext:viewControllerForLocation:]上崩溃 - iPhone 6s - iOS 9.1 crashing on [UICollectionViewController previewingContext:viewControllerForLocation:] 由于曲棍球和乱舞,iOS 9 iPhone 6s应用程序停留在didFinishLaunchingWithOptions - iOS 9 iphone 6s Application stuck at didFinishLaunchingWithOptions due to Hockey and Flurry HTML 视频在 iPhone 6s 设备上的 Safari 中不起作用 - HTML video not working in Safari on iPhone 6s device 启动屏幕旋转无法在iPhone 6s和较小屏幕上运行 - Launchscreen rotation not working on iPhone 6s and smaller screens 如何在iPhone 6 / 6s或iPhone 6 + / 6s +的iOS模拟器中打开显示缩放 - How to turn on Display Zoom in iOS Simulator for iPhone 6/6s or iPhone 6+/6s+ iPhone 6s和iPhone X中的UINavigationBar - UINavigationBar in iphone 6s and in iphone x
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM