0

How can i do for my tag "Encontrados" behaves like a span.i mean that it only take the space of the word necesary , this space can vary for other words like Adopcion or Perdidos but the behave i want its the same, i cant make it work.This is my code:

<View><Text style={styles.tag}>{tagType}</Text></View>

tag: {
        borderRadius: 6,
        borderColor: "#999",
        borderWidth: 2,
        padding: 5,
        marginBottom: 10,
        fontWeight: "600",
        color: "#999"
    }

It looks like a simple question but i new in react and i cant found a solution in the web, thanks for reading.

enter image description here

Franco Coronel
  • 710
  • 1
  • 12
  • 25

1 Answers1

0

I solved it with this code:

<View style={styles.contentView}>
    <Text style={{ borderColor: "#999", borderWidth: 2, borderRadius: 6, padding: 9}}>
        <Text style={styles.tagName}>
             {tagType}
        </Text>
    </Text>
 </View>

tagName: {
  color: "#999"
},
contentView: {
   paddingLeft: 10,
   flex: 1,
   flexDirection:'row',
   flexWrap:'wrap',
   marginBottom: 15
}
Franco Coronel
  • 710
  • 1
  • 12
  • 25