<img/>组件不能包含reactn中的子项

时间:2017-12-15 13:42:26

标签: ios image react-native

错误:组件不能包含子项。如果要在图像上渲染内容,请考虑使用aboslute定位。

1 个答案:

答案 0 :(得分:2)

不再支持具有嵌套内容的

<Image>。如果这是您在我们的应用中所做的事情,请查看<ImageBackground>

<ImageBackground
  style={styles}
  source={source}
  resizeMode={resizeMode}
>