代码如下:
<Text style={{ fontSize: 14, lineHeight: 20, }}> abcdefg <Text style={{ fontFamily: 'AvenirNextCondensed-Medium', fontSize: 18, lineHeight: 24, color: '#d85940', }}> abcdefg </Text> abcdefg。</Text>
目前知道可以通过拆分为 3 个 Text 组件来实现想要的效果, 但这种很不优雅.
还有其他更好的方法吗?
还有一个问题, 如上述代码中, 如何控制相同的行高呢?
![]() | 1 tyrealgray 2017-07-05 00:04:01 +08:00 alignItems: 'center' |
![]() | 2 317765973 OP @tyrealgray 试过了, 不行的. |
![]() | 3 tyrealgray 2017-07-05 13:43:59 +08:00 @317765973 配合设置一下 View 组件样式一起。 |
![]() | 4 317765973 OP @tyrealgray 是拆分为 3 个 Text 组件吗? |
![]() | 5 tyrealgray 2017-07-05 14:07:30 +08:00 via iPhone text 你不好设置排位,得外面加 View 来做设置才行啊 |