2017-01-04 10 views

cevap

6
<Image source={require('./images/MacWallPaper.jpg')} style={styles.container}> 

</Image> 

fiili genişliği ve kaynak resmin yüksekliğini getirir.

container: { 
    flex: 1, 
    justifyContent: 'center', 
    alignItems: 'center', 
    backgroundColor: 'rgba(0, 0, 0, 0)', 
} 

açıkça width: null belirtmek ve height: null bileşen gerçek genişlik ve resmin yüksekliğinin yararlanmaz.

container: { 
    flex: 1, 
    justifyContent: 'center', 
    alignItems: 'center', 
    backgroundColor: 'rgba(0, 0, 0, 0)', 
    // remove width and height to override fixed static size 
    width: null, 
    height: null, 
} 

izle this Video

İlgili konular