Far*_*rwa 6 javascript react-native
我在 Image 标签中有一个 png 图像。部分图像具有透明背景。在我的 android 手机中,它显示为白色。我希望移除白色部分并使其透明。
这是我的代码 -
export default class LoginScreen extends Component {
render() {
return (
<View style={styles.container}>
<View style = {styles.topContainer}>
<Image style = {styles.logoContainer}
source = {require('../images/black_header.png')} />
</View>
</View>
);
}
}
const styles = StyleSheet.create({
logoContainer: {
resizeMode: 'contain',
backgroundColor: "rgba(0,0,0,0)",
width: null,
height: 254,
},
container: {
backgroundColor: "#f7f7f7"
},
topContainer: {
backgroundColor: "rgba(0,0,0,0)"
}
});
Run Code Online (Sandbox Code Playgroud)