[英]Image is out of border and doesn't show on Android
Hi I am trying move logo out of borders for IOS it works fine but Android have a problem the logo is covered by view on background. 嗨,我正在尝试将徽标移出IOS的边界,效果很好,但是Android出现了徽标被背景视图覆盖的问题。 I am tried to set up background color to transparent but doesn't work.
我尝试将背景色设置为透明,但不起作用。 Any idea how to solvate it?
知道如何解决吗?
and here is my code: 这是我的代码:
const styles = StyleSheet.create({
wallWrapper: {
backgroundColor: '#00000000',
borderWidth: 1,
borderColor: 'green',
paddingTop: 40,
},
wallImageBorderEffect: {
borderWidth: 1,
borderColor: 'red',
flex: 1,
justifyContent: 'center',
flexDirection: 'column',
alignItems: 'center',
height: 30,
backgroundColor: 'gray',
},
});
...
render() {
return (
<View style={styles.wallWrapper}>
<View style={styles.wallImageBorderEffect}>
<Image
style={{
height: 45,
width: 105,
position: 'absolute',
bottom: 6,
overflow: 'hidden',
}}
resizeMode="cover"
source={require('./images/mock-logo.png')}
/>
</View>
<View style={{
flex: 1,
justifyContent: 'center',
flexDirection: 'column',
alignItems: 'center',
height: 400,
}}>
</View>
</View>
);
}
}
This is a known issue on Android. 这是Android上的已知问题。 The overflow attribute is not supported on Android yet (only on iOS).
Android尚不支持overflow属性(仅在iOS上)。
But you can support the feature request here . 但是您可以在此处支持功能请求。
You could maybe try to move your <Image />
component outside of the <View />
and fix the position by adjusting top
props. 您可以尝试将
<Image />
组件移到<View />
之外,并通过调整top
道具来固定位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.