react-native-image

React Native App Transport Security has blocked

老子叫甜甜 提交于 2020-08-26 06:57:46
问题 I just installed react-native-image-crop. When I tried to make a photo on an actual iPhone, I received a quite strange error. 'App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.' . Is this because I using the metro builder? or something else maybe? My Info.plist: <key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>localhost</key> <dict> <key

React Native: Why is image stretching vertically to fill container and how to prevent it?

只愿长相守 提交于 2020-06-01 07:05:49
问题 In my React Native app, I have a red box of height 300 that I want to center vertically, and an image that I want to sit inside and at the top of this red box. Here is my code so far: import React, { Component } from 'react'; import { View, Image} from 'react-native'; export default class Login extends Component { render() { return ( <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}> <View style={{ borderWidth: 3, borderColor: 'red', width: "100%", height: 300 }} >

React Native: Why is image stretching vertically to fill container and how to prevent it?

南楼画角 提交于 2020-06-01 07:04:43
问题 In my React Native app, I have a red box of height 300 that I want to center vertically, and an image that I want to sit inside and at the top of this red box. Here is my code so far: import React, { Component } from 'react'; import { View, Image} from 'react-native'; export default class Login extends Component { render() { return ( <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}> <View style={{ borderWidth: 3, borderColor: 'red', width: "100%", height: 300 }} >

Accessing static/local images in React Native

微笑、不失礼 提交于 2019-12-11 06:52:14
问题 In my React Native project folder I have the src files which hold the components, and also some images I want to use across both iOS and Android. If I use this: <Image style={{ width: 200, height: 200 }} source={require('../images/camera.png')} /> then the image loads perfectly. However, the source in the image tag is going to be created dynamically when the user takes a photo. This code: <Image style={{ width: 200, height: 200 }} source={{ uri: '../images/camera.png' }} /> does not work. No

React Native Image Picker: “undefined is not an object (evaluating 'ImagePickerManager.showImagePicker')”

孤街醉人 提交于 2019-12-11 04:27:07
问题 I followed the Readme from react-native-image-picker with both manual and automatic linking (tried both separately). When I launch simulator from terminal using react-native run-ios I get the error. When launching from Xcode it works fine, I can access the CameraRoll picker no problem. Here are the versions I'm using: "react-native": "0.43.3", "react-native-image-picker": "^0.26.3", I saw a similar thread here stackoverflow and it seems I'm not the only one having this issue. Thank you for

Crop image with react-native

大兔子大兔子 提交于 2019-12-10 20:56:19
问题 Hello World, I trying to crop an image like explain on the React-native Doc <Image source={{uri: this.props.image, crop: {left: 50, top: 50, width: 100, height: 100}}} style={{height: 100, width: 100}}/> But it's doesn't work the image is not cropped. Any idea? 回答1: From the docs: On the infrastructure side, the reason is that it allows us to attach metadata to this object. For example if you are using require('./my-icon.png'), then we add information about its actual location and size (don't

Is it possible to get the binary data from an image in React-Native?

落爺英雄遲暮 提交于 2019-12-06 02:57:33
问题 I'm using react-native-camera and I'm having trouble getting the image as binary data in react-native . I need this to be able to upload images to our backend. The only thing I manage to get is uri's to the image and then maybe sending that as FormData to the server but that is not recommended as that would require some infrastructure change to our backend. Is there anyone that know a solution or some tips regarding this issue? Any thoughts or help is very much appreciated. 回答1: If you want

Is it possible to get the binary data from an image in React-Native?

蹲街弑〆低调 提交于 2019-12-04 06:45:02
I'm using react-native-camera and I'm having trouble getting the image as binary data in react-native . I need this to be able to upload images to our backend. The only thing I manage to get is uri's to the image and then maybe sending that as FormData to the server but that is not recommended as that would require some infrastructure change to our backend. Is there anyone that know a solution or some tips regarding this issue? Any thoughts or help is very much appreciated. If you want to get image as binary data from react-native-camera . I recommend to use react-native-fs to read uri Example

Image React-native not working

不问归期 提交于 2019-11-28 09:50:04
问题 Iam trying to do this: <Image style={styles.image} source={require(`./img/${params.image}.png`)} /> but returns me this error: "Unknown named module" 回答1: I have also faced this issue, you can not call image like source={require(`./img/${params.image}.png`)} you have to use another variable to store path and then call it (including require ) For example: let imagePath = require("../../assets/list.png"); Also note that you can not call variable into require. check this ref. url: https://github