Home > Back-end >  Stop View flexing react native
Stop View flexing react native

Time:01-18

How do I make the View not flex and take size of the content Inside in react native.

React Native

CodePudding user response:

You can set the alignSelf style property to flex-start. for example:

<View style={{ alignSelf: 'flex-start' }}>...</View>

alignSelf controls how a child aligns in the cross direction, overriding the alignItems of the parent. It works like align-self in CSS (default: auto). See https://developer.mozilla.org/en-US/docs/Web/CSS/align-self for more details.

  •  Tags:  
  • Related