图像超出边界并且不';在Android上无法显示
您好,我正在尝试将IOS的徽标移出边界。它工作正常,但Android有一个问题,徽标被背景视图覆盖。我试图将背景色设置为透明,但不起作用。 知道如何溶剂化吗 这是我的代码:图像超出边界并且不';在Android上无法显示,android,react-native,Android,React Native,您好,我正在尝试将IOS的徽标移出边界。它工作正常,但Android有一个问题,徽标被背景视图覆盖。我试图将背景色设置为透明,但不起作用。 知道如何溶剂化吗 这是我的代码: const styles = StyleSheet.create({ wallWrapper: { backgroundColor: '#00000000', borderWidth: 1, borderColor: 'green', paddingTop: 40, }, wa
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>
);
}
}
const styles=StyleSheet.create({
墙纸:{
背景颜色:'#00000000',
边框宽度:1,
边框颜色:“绿色”,
paddingTop:40,
},
墙效应:{
边框宽度:1,
边框颜色:“红色”,
弹性:1,
为内容辩护:“中心”,
flexDirection:'列',
对齐项目:“居中”,
身高:30,
背景颜色:“灰色”,
},
});
...
render(){
返回(
);
}
}
这是Android上的一个已知问题。Android上还不支持溢出属性(仅在iOS上)
但您可以支持该功能请求
您可以尝试将您的
组件移动到
之外,并通过调整顶部的道具来固定位置。是的,我知道。当我开始使用RN(0.15)时,我也遇到了同样的问题,我只是希望它已经被修复,但我找不到:(…你是否尝试过移出
组件?我将其溶剂化。对于android,我在中间剪切徽标,并为这两个部分准备视图,对于ios,我有这个解决方案很酷,很高兴听到这一点