无法使用 react-native android 从内部存储中读取图像
Can't read image from internal storage using react-native android
当我在 uri 中传递“file://”时无法读取图像文件
<View>
<Text>
YOLO
</Text>
<Image
style={styles.tinyLogo}
source={{
uri: "file:///storage/emulated/0/DCIM/Screenshots/Fun.jpg",
}}
/>
</View>
尝试在 AndroidManifest 文件的 application 标签内添加以下标签:
android:requestLegacyExternalStorage="true"
例如:
<application
// ...
android:requestLegacyExternalStorage="true"
>
//...
</application>
此外,请确保您要求用户提供存储权限。
当我在 uri 中传递“file://”时无法读取图像文件
<View>
<Text>
YOLO
</Text>
<Image
style={styles.tinyLogo}
source={{
uri: "file:///storage/emulated/0/DCIM/Screenshots/Fun.jpg",
}}
/>
</View>
尝试在 AndroidManifest 文件的 application 标签内添加以下标签:
android:requestLegacyExternalStorage="true"
例如:
<application
// ...
android:requestLegacyExternalStorage="true"
>
//...
</application>
此外,请确保您要求用户提供存储权限。