Sto provando a eseguire il rendering di un blocco con testo bianco sopra un'immagine nei miei test di React Native. Ma invece ho un blocco nero sopra la mia immagine con testo bianco. Non quello che mi aspettavo. Come si esegue il rendering di un blocco di testo con sfondo trasparente?Rendering casella di testo con sfondo trasparente sopra l'immagine in React Native iOS
risultato attuale
Render Funzione
render: function(){
return (
<View style={styles.container}>
<Image
style={styles.backdrop}
source={{uri: 'https://unsplash.com/photos/JWiMShWiF14/download'}}>
<Text style={styles.headline}>Headline</Text>
</Image>
</View>
);
)
Stylesheet
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'flex-start',
alignItems: 'center',
backgroundColor: '#000000',
width: 320
},
backdrop: {
paddingTop: 60,
width: 320,
height: 120
},
headline: {
fontSize: 20,
textAlign: 'center',
backgroundColor: 'rgba(0,0,0,0)',
color: 'white'
}
});
Attenzione, questo è ora deprecato: "Uso con i bambini è deprecato e sarà un errore di il futuro prossimo. Riconsegna il layout o usa . " –