Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS ReactNative: Text not wrapping and displaying off-screen

I seem to have a problem with a simple text field. The text inside is not wrapping. I'm running on an iOS 5s simulator. Any ideas?

Text Not Wrapping

Following the tutorial here: http://www.raywenderlich.com/99473/introducing-react-native-building-apps-javascript

Styles:

var styles = StyleSheet.create({
 description: {
   marginBottom: 20,
   fontSize: 18,
  textAlign: 'center',
  color: '#656565',
},
container: {
  padding: 30,
  marginTop: 65,
  alignItems: 'center',
},

Code:

<View style={styles.container}>
      <Text style={styles.description}>
          Search for houses to buy!
      </Text>
      <Text style={styles.description}>
          Search by place-name, postcode or search near your location!
      </Text>
</View>
like image 272
SparkyRobinson Avatar asked Sep 27 '22 06:09

SparkyRobinson


1 Answers

I ran the exact code on rnplayground simulator, but the text did wrap correctly. If you had an outside flex container, you may need to specify the flexWrap property to 'wrap'.

rnplay.org/apps/x0Xf6w

like image 77
Nader Dabit Avatar answered Sep 28 '22 22:09

Nader Dabit