简体   繁体   English

反应本机 expo Android 模拟器未呈现 uri 图像

[英]React native expo Android emulator is not rendering uri image

I have Android emulator rendering text successfully, however it is not rendering image with uri.我有 Android 模拟器成功渲染文本,但是它没有用 uri 渲染图像。 Funny thing iOS simulator rendering both text and image.有趣的是 iOS 模拟器渲染文本和图像。 What could be the problem?可能是什么问题呢? should I add anything for Android?我应该为 Android 添加任何内容吗? here is my code,这是我的代码,

export default function App() {
  return (
    <View style={styles.container}>
      <Image
        source={{
          width: 200,
          height: 300,
          uri: "https://picsum.photos/200/300",
        }}
      />
      <Text> App</Text>
    </View>
  );
}

try using the style prop to the styles and the source prop to the source of the image尝试使用 styles 的style道具和图像源的source道具

export default function App() {
  return (
    <View style={styles.container}>
      <Image
        style={{ width: 200, height: 300}}
        source={{uri: 'https://picsum.photos/200/300'}}
      />
      <Text> App</Text>
    </View>
  );
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM