小编Cur*_*tis的帖子

如何在React Native中的<Text>组件中插入换行符?

我想在React Native的Text组件中插入一个新行(如\ r \n,<br />).

如果我有:

<text><br />
Hi~<br >
this is a test message.<br />
</text>
Run Code Online (Sandbox Code Playgroud)

然后React Native渲染 Hi~ this is a test message.

是否可以渲染文本添加新行,如下所示:

Hi~
this is a test message.
Run Code Online (Sandbox Code Playgroud)

javascript text newline react-native

262
推荐指数
14
解决办法
24万
查看次数

标签 统计

javascript ×1

newline ×1

react-native ×1

text ×1