iOS ReactNative:文本不包装并在屏幕外显示

时间:2015-11-10 08:56:43

标签: ios react-native

我似乎对简单的文本字段有疑问。里面的文字没有包装。我在iOS 5s模拟器上运行。有什么想法吗?

Text Not Wrapping

按照此处的教程:http://www.raywenderlich.com/99473/introducing-react-native-building-apps-javascript

样式:

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

代码:

<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>

1 个答案:

答案 0 :(得分:2)

我在rnplayground模拟器上运行了确切的代码,但文本确实正确包装。如果您有一个外部Flex容器,则可能需要指定flexWrap属性以包装&#39;。

rnplay.org/apps/x0Xf6w

相关问题