React-native Vision Camera无法缩放
React-native Vision Camera unable to zoom
我无法在 ios 设备上放大 https://github.com/mrousavy/react-native-vision-camera。我可以在 android 设备上毫无问题地放大,但无法在 iPhone 或 iPad 上放大任何人都可以帮助我。
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;
我无法在 ios 设备上放大 https://github.com/mrousavy/react-native-vision-camera。我可以在 android 设备上毫无问题地放大,但无法在 iPhone 或 iPad 上放大任何人都可以帮助我。
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;