React Native 中的上标文本 [英] Superscript Text in React Native

查看:26
本文介绍了React Native 中的上标文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 React Native 中将文本样式设置为上标.这将如何实现?有没有办法利用 Javascript sup() 字符串方法在 对象中返回一个字符串作为上标?

I would like to style text as superscript in React Native. How would this be accomplished? Is there a way to make use of the Javascript sup() string method to return a string as superscript within a <Text> object?

推荐答案

我使用视图容器和 flex 得到了这个.

I got this working for me using a view container and flex.

<View style={{flexDirection: 'row', alignItems: 'flex-start'}}>
    <Text style={{fontSize: 20, lineHeight: 30}}>10</Text>
    <Text style={{fontSize: 11, lineHeight: 18}}>am</Text>
</View>

这是实际操作的链接https://repl.it/Haap/0

干杯!

这篇关于React Native 中的上标文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆