Layout and Flexbox

Since Flexbox is the foundation of React Native's layout, we are going to explore it in depth. If you are already familiar with the intricacies of Flexbox, feel free to jump to the Styling the NavigationBar component section. There we will focus more on the styling of the components that we made in the previous chapter.

Flex container

The flex container is the parent element that describes how children or flex items are laid out. The flexDirection property of the container specifies the main-axis; the primary direction in which the items are rendered. The line perpendicular to the main-axis is called the cross-axis. Different flex properties on the container affect how the items are aligned across each axis. The flexDirection ...

Get Getting Started with React Native now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.