I can't seem to change the flex property on this react native view

96 Views Asked by At

I'm using shoutem/ui http://shoutem.github.io/docs/ui-toolkit/components/rows components and I can't seem to get this row item to have a smaller height - it seems to be taking the full flex height. how do I get the orange area to be smaller? I tried setting the flex and height properties but it doesn't seem to work.

     <TouchableWithoutFeedback onPress={() => this.toggleRegister(true)}>
        <Row style={{backgroundColor:"#ff7f50", height: 20, flex: 0.2}} styleName="small">
          <Icon name="edit" />
          <Text>Don't have an account?</Text>
          <Icon styleName="disclosure" name="right-arrow" />
        </Row>
      </TouchableWithoutFeedback>

enter image description here

2

There are 2 best solutions below

0
On

The Row component might not actually take style...could you try moving the style to TouchableWithoutFeedback or surrounding it with a View?

0
On

Judging by the documentation, the Row component doesn't take style, so just use styleName.

<Row styleName="small">
    <Icon name="edit" />
    <Text>Don't have an account?</Text>
    <Icon styleName="disclosure" name="right-arrow" />
</Row>