首页 > 解决方案 > React Native Expo - 放大图像大小会导致未包含所有图像

问题描述

这是我的图像组件:

<Marker  
  style={{width: this.state.smallItemsSize, height: this.state.smallItemsSize}}
  key={itemInstance.id}
  coordinate={{
    latitude: itemInstance.lat,
    longitude: itemInstance.lng
  }}> 
  <Image resizeMethod='resize' resizeMode="stretch" source={{ uri: `${Constants.manifest.extra.server.baseUrl}${itemInstance.imageUrl}` }} width={50} height={50} style={{width: this.state.smallItemsSize, height: this.state.smallItemsSize}} />
</Marker>

当我将状态更改为更大的数字时,将导致如下:

放大前 放大

但是如果我将状态更改为较小的数字,然后再将其放大,一切都很好..是错误还是什么?据我记得,以前一切都很好。

标签: react-nativeexpo

解决方案


我通过向标记样式添加最大可能大小来解决我的问题。


推荐阅读