React Native使用网络图片
微瞰技术 博客专家认证 2017-03-03 04:29:19 使用的是搜索的图片。
代码如下
import React, { Component } from 'react';
import { AppRegistry, Image } from 'react-native';
class Bananas extends Component {
render() {
let pic = {
uri: 'http://image.so.com/v?q=%E7%BE%8E%E5%A5%B3&src=360pic_strong&fromurl=http%3A%2F%2Ft.55bbs.com%2Fpin%2F2362978%2F#q=%E7%BE%8E%E5%A5%B3&src=360pic_strong&fromurl=http%3A%2F%2Ft.55bbs.com%2Fpin%2F2362978%2F&lightboxindex=0&id=0a5a8fbd135f8616618d5a5875f2a6aa&multiple=1&itemindex=0&dataindex=0'
};
return (
<Image source={pic} style={{width: 193, height: 110}} />
);
}
}
AppRegistry.registerComponent('Bananas', () => Bananas);
但是最后在Android Studio中显示
CANNOT TRANSLATE guest DNS ip