Merge pull request #169 from tianling536/master

fixed cannot display local image on android
This commit is contained in:
Dylan Vann 2018-03-19 08:00:03 -04:00 committed by GitHub
commit 3bcb02219c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { import {
Platform,
View, View,
Image, Image,
NativeModules, NativeModules,
@ -33,7 +34,7 @@ class FastImage extends Component {
} = this.props } = this.props
// If there's no source or source uri just fallback to Image. // If there's no source or source uri just fallback to Image.
if (!source || !source.uri) { if (!source || !source.uri || (Platform.OS === 'android' && source.uri.startsWith('file://'))) {
return ( return (
<Image <Image
ref={e => (this._root = e)} ref={e => (this._root = e)}