Я создаю приложение, которое создает пригласительную карточку, я делаю карточку, используя ImageBackground, а затем оформляю содержимое внутри нее, но я столкнулся с проблемой с другим размером экрана и разрешением, мои коды такие, как показано ниже:
<ImageBackground
resizeMode='contain'
backgroundColor={this.state.bgColor}
style={{
height: height / 3 + 20,
width: width,}}
source={this.state.border}>
<View style={{ flex: 1, marginRight: 10,
marginLeft: 45, marginTop: 10 }}>
<Text style={{ fontSize: height / 37,
color: this.state.fontColor,
fontWeight: '700',
textAlign: 'center',
fontFamily: this.fonttext }}>{this.type}</Text>
<Text style={{ marginLeft: 40,
marginRight: 5, marginTop: 10,
fontSize: height / 48,
color: this.state.fontColor,
textAlign: 'right',
fontFamily: this.fonttext }}>{this.body}</Text>
<Text style={{ fontSize: height / 49,
marginTop: 10,
color: this.state.fontColor,
textAlign: 'right',
fontFamily: this.fonttext }}>{this.location}</Text>
<View style={{ alignItems: 'center',
justifyContent: 'center',
marginTop: (height / 3 + 10) / 11 }}>
<Text style={{ fontSize: height / 49,
fontWeight: 'bold',
color: this.state.fontColor,
textAlign: 'right',
fontFamily: this.fonttext }}>From</Text>
<Text style={{ fontSize: height / 49,
color: this.state.fontColor,
textAlign: 'right',
fontFamily: this.fonttext }}>{this.fromD}</Text>
</View>
<Text style={{ fontSize: height / 55,
color: this.state.fontColor,
textAlign: 'right',
fontFamily: this.fonttext }}>{'*' + this.notes}</Text>
</View>
</ImageBackground>
он отлично работает на Iphone 6
![enter image description here](https://i.stack.imgur.com/1kp34.png)
Но на Iphone x, 8 plus и на устройствах Android вид меняется ифоновое изображение имеет некоторый запас как сверху, так и слева, хотя я использовал Размеры, чтобы я мог получить высоту и ширину экрана, чтобы я мог соответственно настроить вид, но не сработал, что лучше всего сделать вэтот сценарий, поэтому представление будет одинаковым на всех устройствах.
![enter image description here](https://i.stack.imgur.com/hgvDE.png)