在 React Native 中,由于文本的长度,在 Text 组件中会自动换行。自动换行后如何保持所需的缩进?
Text Indentation on React Native
这个问题回答了如何使用文本组件创建缩进,但没有解决像 user3191334 询问的多行缩进。
例如,如果我们使用单行缩进
<Text>{'\t'}Hello, my name is John.</Text>
移动屏幕上的输出可能是: Hello, my name is
John.
我想这样做,所以输出是: Hello, my name is
John.
最佳答案
添加 paddingLeft
文本样式中的属性。这是一个例子
<Text style={{paddingLeft:100}}>this is just and example </Text>
关于javascript - React Native 多行文本缩进,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68674913/