0

我有一个可以工作但高度超过的图像背景,我不知道如何使它适合屏幕。事实上,它“切割”了图像的顶部。

原图:

在此处输入图像描述

我的代码:

  <ImageBackground
source={require("../../assets/images/background-stats.jpg")}
style={{flex: 1,
width: "100%",
height: "100%",
resizeMode: 'contain',
justifyContent: 'center'
}}

结果 : 在此处输入图像描述

4

1 回答 1

1
imageStyle={{ resizeMode: 'cover' }}

或者

imageStyle={{ resizeMode: 'stretch' }}
于 2020-08-18T06:37:46.840 回答