我想在 React Native 的 Text 组件中插入一个新行(如\r\n、
)。
如果我有:
<text>
<br />
Hi~<br />
this is a test message.<br />
</text>
然后 React Native 渲染 Hi~ 这是一条测试消息。
渲染文本是否可以像这样添加新行:
Hi~
this is a test message.
最佳答案
应该这样做:
<Text>
Hi~{"\n"}
this is a test message.
</Text>
关于javascript - 如何在 React Native 中的 <Text> 组件中插入换行符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32469570/