反应现象相机无法缩放

发布于 2025-01-23 17:24:48 字数 364 浏览 3 评论 0原文

我无法放大 https://github.com/mrousavy/mrousavy/mrousavy/reaect-native-native-native-native-native-native-native-native-native-native-native-native-native-native-native-native-nativ一下一下iOS设备上的视觉相机。我可以毫无问题地放大Android设备,但无法缩放iPhone或iPad,任何人都可以帮助我。

I am unable to zoom in https://github.com/mrousavy/react-native-vision-camera on ios devices. I am able to zoom in on android devices without any problem but unable to zoom on iPhones or iPads can anyone help me.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

虐人心 2025-01-30 17:24:48
import React, { useCallback, useEffect, useRef } from 'react';
import { Alert, FlatList, View } from 'react-native';
import { Camera, useCameraDevices } from 'react-native-vision-camera';


const SystemCamera = () => {

    const devices: any = useCameraDevices();
    const device = devices.back;

    const [isCameraInitialized, setIsCameraInitialized] = useState(false);

    let cameraRef: any = useRef<Camera>(null);

    const onCameraInitialized = useCallback(() => {
        setIsCameraInitialized(true);
    }, []);

    useEffect(() => {
        checkCameraPermission(componentId);
    }, []);


    if (device == null) return;
    return (
        <ThemeProvider
            children={
                <View style={{ flex: 1 }}>
                    <Camera
                        hdr={true}
                        photo={true}
                        ref={cameraRef}
                        isActive={true}
                        focusable={true}
                        enableZoomGesture={true}
                        device={device}
                        onInitialized={onCameraInitialized}
                    >
                        {children}
                    </Camera>
                </View>
            }
        />
    )
}

export default SystemCamera;
import React, { useCallback, useEffect, useRef } from 'react';
import { Alert, FlatList, View } from 'react-native';
import { Camera, useCameraDevices } from 'react-native-vision-camera';


const SystemCamera = () => {

    const devices: any = useCameraDevices();
    const device = devices.back;

    const [isCameraInitialized, setIsCameraInitialized] = useState(false);

    let cameraRef: any = useRef<Camera>(null);

    const onCameraInitialized = useCallback(() => {
        setIsCameraInitialized(true);
    }, []);

    useEffect(() => {
        checkCameraPermission(componentId);
    }, []);


    if (device == null) return;
    return (
        <ThemeProvider
            children={
                <View style={{ flex: 1 }}>
                    <Camera
                        hdr={true}
                        photo={true}
                        ref={cameraRef}
                        isActive={true}
                        focusable={true}
                        enableZoomGesture={true}
                        device={device}
                        onInitialized={onCameraInitialized}
                    >
                        {children}
                    </Camera>
                </View>
            }
        />
    )
}

export default SystemCamera;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文