我想要寫的樣式表來顯示這樣的圖像一個loyout:反應的其它視圖的本機映像前
化身:
我寫這樣的代碼:
<View style={styles.header}></View>
<View style={styles.meInfor}>
<Image style={styles.avatar}
source={require('../../images/cristiano-ronaldo.jpg')} />
</View>
and style:
header:{
width: width,
height: 100,
backgroundColor: '#1270BA',
},
meInfor:{
width: width,
backgroundColor: '#FFFFFF',
alignItems: 'center',
justifyContent: 'center',
},
avatar: {
marginTop: -50,
width: 100,
height: 100,
borderRadius: 100,
}
我用marginTop: - 50
拉頭像頂部,但結果是這樣的:
壞的結果:
我該怎麼做才能樣式這將化身像第一個圖像?
嘗試使用位置:「絕對」阿凡達 –
我加入這個屬性和隱藏的頭像。 :( –
由兩個柄圖像去除餘量也 –