React Native,当我生成android apk时,它在顶部的缺口处带有一个白色条,如何删除它?

ruoxqz4g  于 2023-03-24  发布在  React
关注(0)|答案(1)|浏览(111)

我通过博览会编程,当我在我的手机上测试它的应用程序是填补整个屏幕正常,测试后,我使用命令eas build -p android --profile preview创建apk,下载APK并安装在我的Android手机上,然而,当我安装它总是有一个白色的酒吧在所有屏幕的顶部,我已经尝试了一切,但我不能从APK中删除它,当我通过博览会测试一切都很好,问题只是在APK,有谁知道如何删除这个酒吧顶部白色?
how is it in the apk
how it looks at the expo, it's the way I want it to look, it's the same code
下面是其中一个屏幕的代码示例:

return (
<View style={styles.container}>
  <ImageBackground source={require('../../assets/fundog02.jpg')} style={ styles.imgBack}>
  <ScrollView showsVerticalScrollIndicator={false}>

  <View style={styles.areaIcone}>
    <Image source={require('../../assets/saude.png')} style={ styles.imgIcone }/>
    <Text style={styles.textoIcone}> Saúde </Text>
  </View>

  <View style={styles.areaBoxes}>
                <View style={styles.box1}>
                    <ImageBackground source={require('../../assets/fundo04.jpg')} imageStyle={{ borderRadius: 10}} style={ styles.imgBox }>
                        <TouchableOpacity onPress={() => navigation.navigate('Hospitais')}>
                            <View style={ styles.areaConteudo }>
                                <Image source={require('../../assets/hospital.png')} style={styles.imgIconeBox}/>
                                <Text style={styles.textoBox}> Hospitais </Text>
                            </View>
                        </TouchableOpacity>
                    </ImageBackground>
                </View>

                <View style={styles.box1}>
                    <ImageBackground source={require('../../assets/fundo04.jpg')} imageStyle={{ borderRadius: 10}} style={ styles.imgBox }>
                        <TouchableOpacity onPress={() => navigation.navigate('UAPS')}>
                            <View style={ styles.areaConteudo }>
                                <Image source={require('../../assets/upa128.png')} style={styles.imgIconeBox}/>
                                <Text style={styles.textoBox}> UAPS </Text>
                            </View>
                        </TouchableOpacity>
                    </ImageBackground>
                </View>

        </View>

        <View style={styles.areaBoxes}>
                <View style={styles.box2}>
                    <ImageBackground source={require('../../assets/fundo04.jpg')} imageStyle={{ borderRadius: 10}} style={ styles.imgBox }>
                        <TouchableOpacity onPress={() => navigation.navigate('Vacinas')}>
                            <View style={ styles.areaConteudo }>
                                <Image source={require('../../assets/vacina.png')} style={styles.imgIconeBox}/>
                                <Text style={styles.textoBox}> Vacinas </Text>
                            </View>
                        </TouchableOpacity>
                    </ImageBackground>
                </View>

        </View>
        </ScrollView>
  </ImageBackground>
</View>

); }
const styles = StyleSheet.create({ container:{ flex:1,backgroundColor:'#1C1C1C',},imgBack:{ flex:1,高度:'100%',宽度:'100%',resizeMode:“封面”},图像范围:{高度:100,宽度:100,},areaIcone:{ alignItems:'居中',对齐内容:'center',marginBottom:'5%',marginTop:'15%' },textoIcone:{ fontSize:30,fontWeight:“粗体”,颜色:'white',textShadowColor:'rgba(0,0,0,0.75)',textShadowOffset:{宽度:-1,高度:1},textShadowRadius:10,},box1:{ width:'45%',borderRadius:20,alignItems:'居中',对齐内容:'center',marginTop:“2%”,shadowColor:“#000”,阴影偏移:{ width:0,height:2,},shadowOpacity:0.25,阴影半径:3.84,标高:5、marginHorizontal:'1%' },box2:{ width:'90%',borderRadius:20,alignItems:'居中',对齐内容:'center',marginTop:“2%”,shadowColor:“#000”,阴影偏移:{ width:0,height:2,},shadowOpacity:0.25,阴影半径:3.84,标高:5、marginHorizontal:'1%' },imgBox:{ flex:1,高度:'100%',宽度:'100%',alignItems:'居中',对齐内容:'center' },areaBoxes:{ flexDirection:“行”,对齐项:'居中',对齐内容:'center' },areaConteudo:{ flexDirection:'column',alignItems:'居中',对齐内容:'center',marginTop:'10%' },imgIconeBox:{ width:70,身高:70、justifyContent:'居中',对齐项目:'center' },textoBox:{ fontSize:20,字体粗细:“粗体”,颜色:'white',paddingTop:15、paddingBottom:20,文本阴影颜色:'rgba(0,0,0,0.75)',textShadowOffset:{宽度:-1,高度:1},textShadowRadius:10、文本对齐:'中心' },});'
导航员:
<Stack.Navigator>〈Stack.Screen name='Saude' component={Saude} options={{ headerTransparent:true,headerTintColor:'white',headerTitle:联系我们</Stack.Navigator>
我尝试safeAreaView和paddingTop:0但没有什么工作,我希望apk是一样的世博会的测试版

h43kikqp

h43kikqp1#

如果你不需要导航器标题,你可以把它写下来吗?

options={{ headerShown: false }}

其解决?

相关问题