Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReactNative/Flex: how to arrange two components horizontal?

How to arrange 2 Image-Components next to another in the same row with flex?

Like this:

|| (image 1) || (image 2) ||

like image 946
delete Avatar asked May 27 '16 21:05

delete


People also ask

How do you align components horizontally React?

To center a component horizontally and vertically in React. js, set its display property to flex and its alignItems and justifyContent properties to center . The components's content will be horizontally and vertically centered.

How do you overlap two components in React Native?

Wrap both of your components inside the <SafeAreaView/> component which React Native provides. The BottomContainer wraps the content of the scroll view. I have assigned the Image Height to 450px. This can vary depending upon the design and screen dimensions.

How do you align text horizontally Center in React Native?

How do I show text in center in React Native? To make text align center horizontally, apply this Property (textAlign:”center”) . Now to make the text align vertically, first check direction of flex. To Make text align center apply same property ( textAlign:”center” ).


1 Answers

flexDirection: 'row' is your friend

like image 183
itinance Avatar answered Dec 02 '22 12:12

itinance