Within my React Native app, I have constructed the following view:
<ScrollView style={{ width: 250, height: '100%', backgroundColor: '#000000' }}>
<SafeAreaView
style={{
flex: 1,
flexWrap: 'nowrap',
height: '100%',
backgroundColor: '#ffffff',
flexDirection: 'row',
width: '100%',
}}
>
<View style={{ width: 50, height: '100%', backgroundColor: 'powderblue' }} />
<View style={{ width: 200, height: '100%', backgroundColor: 'skyblue' }} />
</SafeAreaView>
</ScrollView>
I have utilized flex properties and ensured that all base containers have a height of 100%. Now, I will illustrate the expected and actual outcomes...
Actual Result:
https://i.sstatic.net/2D2kn.png
Expected Result:
https://i.sstatic.net/PQK5d.png
My Objective:
My goal is to create a sidebar with two Views
. The first view should be 50px wide and the second one should be 200px wide, totaling 250px. They should be placed next to each other to accommodate buttons (squares) on the left and navigation links on the right. Despite the content, I want to ensure that the background colors remain visible by setting all heights to 100%.
How can I achieve this?