【发布时间】:2018-08-02 07:17:09
【问题描述】:
我只有 1 张图片需要 zIndex 才能在前面显示。它适用于 Android,但不会出现在 IOS 设备中。不知道为什么。
如您所见,用户图像没有出现在 IOS 中。
代码是这样的:
<View>
<Image
source={require("./images/user-img.png")}
style={{width:95,height:95,marginTop:10,marginLeft:135,position:'absolute',zIndex:1}}
/>
<ImageBackground
source={require("./images/bg-img.png")}
style={{ width: "100%", height: "100%"}}>
<View>
//extra code here
</View>
</ImageBackground>
</View>
有人知道原因吗?
【问题讨论】:
-
尝试 zindex 与海拔 {elevation: 1000,zIndex:1000}
标签: javascript ios react-native z-index