父component
有以下樣式廣場右上角反應本土
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#FFF',
alignItems: 'center',
justifyContent: 'center',
},
});
我把另一component
此組件內。我希望它在右上角。
當然,我會用下面的風格去這個孩子component
:
const styles = StyleSheet.create({
container: {
...StyleSheet.absoluteFillObject,
top: 20,
right: 5,
},
});
然而,將它置於頂部左角落。我可以將它移動到右側角落的唯一方法是用left: 500
替換right: 5
。但是那一種不是要走的路...
有關使用'alignSelf什麼:「柔性端'' –
也刪除CSS和樣式表標記,因爲它不會幫助,或者你會得到這個 –
@JigarShah刪除的CSS解決方案。這有幫助。它將它移到右邊。但是,現在在中間水平地說出它的位置。 – Stophface