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

干杯!