我正在使用 NativeBase 和 Exponent。标题位于手机状态栏下方。您可以在本地库 https://getexponent.com/@community/native-baseExponent 发布的演示。
有人能解决这个问题吗?
由于此问题仅出现在 Android 中,因此建议解决此问题的方法是专门针对 Android 使用Platform :
import {Platform, StatusBar} from 'react-native'
const styles = StyleSheet.create({
container: {
flex: 1,
...Platform.select({
android: {
marginTop: StatusBar.currentHeight
}
})
}
})
其中容器是应用程序中的主容器。
<View style={styles.container}>
// rest of the code here
</View>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)