簡體   English   中英

如何在react-native中分別在同一行上放置多個按鈕?

[英]How to position multiple buttons on the same line separately in react-native?

我想分別在同一行創建兩個按鈕。我使用flex = 2但它不能正常工作。我該如何解決?

<View style={{ flex: 2,flexDirection: "row" ,marginLeft:20}}>
    <BtnDft h={40} w={100} name={ "Update"} />
    <BtnDft h={40} w={100} name={ "Log out"} />
</View>

刪除flex: 2

{ flexDirection: "row" ,marginLeft: 20, justifyContent: 'space-evenly' }

使用justifyContent更改按鈕的位置,可用選項包括flex-startcenterflex-endspace-aroundspace-betweenspace-evenly

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM