【发布时间】:2020-12-09 23:59:35
【问题描述】:
当背景图像可以通过不同的设备分辨率调整大小时,是否可以使用绝对位置对齐图像并保持相同的位置? 还有其他解决办法吗?
这是我目前正在尝试解决的问题:
414 x 896 像素设备上的图像
360 x 672px 设备上的图像
这就是我想要做的:
<View style={{position: 'relative'}}>
<Image
resizeMode="contain"
style={{flex: 1, flexGrow: 1}}
source={Assets.Mobile.RemoteControl} // The background image with 3 icons
/>
<Image
style={{
position: 'absolute',
top: '6.8%',
left: '19%',
}}
source={Assets.Mobile.RemoteRectangleButtonBorder} // The rounded border
/>
</View>
【问题讨论】: