我正在尝试在矢量图标(显示7日历图标上方显示7)上居中显示一个文本,我正在使用react-native-vector-icon,绝对,但没有运气,直到现在居中文本上方的矢量图标上方React本地
<View style={{alignItems: 'center', alignSelf: 'center', justifyContent: 'center'}}>
<Icon name='ios-calendar-outline' style={styles.iconStyle}/>
<Text style={{position: 'absolute', alignItems: 'center', alignSelf: 'center', justifyContent: 'center'}}></Text>
</View>
是否有可能做这样的事情?
这些引用可能会或可能不会有所帮助: https://www.theodo.fr/blog/2017/04/react-native-layout-tricks/, https://facebook.github.io/react-native /docs/flexbox.html#layout-with-flexbox –