0

I have:

        <StyledSurface style={{ flex: 1, flexDirection: 'row', flexWrap: 'wrap' }}>
            {conversations.map((c, i) => (
                <Surface style={{ backgroundColor: 'red', width: '46%', margin: '2%', flexDirection: 'column', flexShrink: 1, alignSelf: 'flex-start'}} key={i}>
                    <Text style={{flex: 1}}>{c.title}</Text>
                </Surface>
            ))}
        </StyledSurface>

and this ends up looking like:

enter image description here

But I want each red box to shrink (vertically) to fit the contents and have equal spacing?

What am I missing?

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
Shamoon
  • 41,293
  • 91
  • 306
  • 570

1 Answers1

2

On the View container add this:

alignSelf: 'flex-start',

Should do the trick

MIPB
  • 1,770
  • 2
  • 12
  • 21