【发布时间】:2015-12-04 20:00:15
【问题描述】:
我想在 React Native 的 Text 组件中插入一个新行(如 \r\n、
)。
如果我有:
<text>
<br />
Hi~<br />
this is a test message.<br />
</text>
然后 React Native 渲染 Hi~ this is a test message.
渲染文本是否可以像这样添加新行:
Hi~
this is a test message.
【问题讨论】:
-
你可以在你想换行的地方使用
\n。 -
no \n 将不起作用。我用了。我建议使用 html 标签进行渲染并使用 css 或简单地
text
。你可以使用。
标签: javascript text react-native newline