Description
`import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import React from 'react';
import {RFValue} from 'react-native-responsive-fontsize';
import {captureRef} from 'react-native-view-shot';
const SettingScreen = () => {
const imageRef = React.useRef(null);
const onSaveImageAsync = async () => {
try {
const localUri = await captureRef(imageRef, {
height: 440,
quality: 1,
});
// await MediaLibrary.saveToLibraryAsync(localUri);
// if (localUri) {
// alert('Saved!');
// }
} catch (e) {
console.log(e);
}
};
return (
<View style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>
<Image
source={{uri: 'https://i.pravatar.cc/300'}}
style={{
height: 200,
width: 200,
borderRadius: 100,
resizeMode: 'cover',
}}
/>
<TouchableOpacity
style={{marginTop: RFValue(100)}}
onPress={onSaveImageAsync}>
<Text>Save</Text>
</TouchableOpacity>
</View>
);
};
export default SettingScreen;
const styles = StyleSheet.create({});
`
its not working i also add collapsable={false} but it seems to be broke
version ==> "react-native-view-shot": "^4.0.3",