react-native - 如何使嵌套文本,第二个文本不换行?
问题描述
https://facebook.github.io/react-native/docs/text#docsNav 官方文档中嵌套文本的描述,但我想要另一个效果
<Text>
<Text>First part and </Text>
<Text>second part</Text>
</Text>
// Text container: the text will be inline if the space allowed it
// |First part and second part|
// otherwise, the text will flow as if it was one
// |First part |
// |and second |
// |part |
我希望“第二部分”不要包装,例如:
// |First part |
// |and |
// |second part|
// or
// |First part and |
// |second part |
不是这个:</p>
// |First part and second p|
// |art |
不希望“第二部分”被截断。谢谢!
解决方案
您可以尝试这样不要使用嵌套文本<Text>{'First part and\nsecond part'}</Text>
推荐阅读
- c# - C# 控制台项目 - NUnit 检查验证消息
- c# - 我可以动态创建一个表达式
> 谓词,但我如何创建表达式 > - django - Django:USE_TZ = False 未更新 Postgres 数据库设置
- r - Cowplot 包:使用 R 中的 plot_grid() 对齐绘图空间左上角的文本标签
- android - 为什么我的 Glide 不缓存图像?似乎重新下载图像
- android - 我使用 OTP 的 Firebase 身份验证不起作用
- ios - 如何从设备连接到 Stripe 服务器?
- python - 如何在 Python 中将输入数据存储到多个矩阵中?
- c++ - UWP C++/CX:当前系统时间和秒表
- java - 无法将 super 关键字作为参数传递给 java 中的方法