如何在本机反应中删除导航标题填充和边距?

如何解决如何在本机反应中删除导航标题填充和边距?

我正在参加世博会并为此来回奔波。我正在尝试清理内容顶部和底部标题部分。当我在没有导航容器的情况下运行代码时,一切都按设计正常工作,但现在我必须路由新屏幕并绑定到按钮,我无法删除它。我尝试了从主容器样式表将边距设置为 0 并将填充设置为 0 的所有方法。我还使用 Globalstyle 将所有组件推到了具有适当边距的清晰区域。

enter image description here

如果你看一看,屏幕的顶部和底部都有黑条。我想专门删除那个。

export default function App() {

const Stack = createStackNavigator();

 return (
    <NavigationContainer style={GlobalStyles.NotchAware}>
      <Stack.Navigator initialRouteName="Home"
          >
        <Stack.Screen
          name="Home"
          component={Welcome}
          options={{
            headerShown:false,}}
          />
      </Stack.Navigator>
  </NavigationContainer>
 )  ;
}

对于 app.js 仅使用这种样式

NotchAware: {
    flex: 1,paddingTop: Platform.OS === 'android' ? 25 : 0,marginLeft: 5,marginRight: 5,marginBottom: 5,},

这些是一些组件代码和样式。

 export default function Welcome() {
 const [active,setActive] = useState(0);

 const nextAction = () => {
 }

 const skipAction = () => {
 
 }
 return (
 <SafeAreaView style={styles.container}>
  <StatusBar style="auto" />
  <View style={styles.cardContainer}>
    <WelcomeCard />
  </View>

  <View style={styles.cardTextContainer}>
    <Text style={styles.cardText}>Let’s make learning more fun than ever.</Text>
  </View>

  <View style={styles.buttonContainer}>
        <View>
            <TouchableOpacity style={styles.skipButton} onPress={skipAction}>
                <Text style={styles.buttonText}>Skip</Text>
            </TouchableOpacity>
        </View>
        <View>
            <Dots length={2} active={active} />
        </View>
        <View>
            <TouchableOpacity style={styles.nextButton} onPress={nextAction}>
                <Text style={styles.buttonText}>Next</Text>
            </TouchableOpacity> 
        </View>
  </View>
  </SafeAreaView>
  );
  }

  const styles = StyleSheet.create({
  container: {
    flex: 1,marginTop: 50,marginBottom: 20,backgroundColor: '#fff',justifyContent: 'space-between',buttonContainer : {
    flexDirection: 'row',justifyContent: 'space-evenly',cardTextContainer : {
    width: 221,textAlign: 'center',marginLeft: 'auto',marginRight: 'auto',cardContainer : {
    flexDirection: 'row',alignItems: 'center',justifyContent: 'center',cardText: {
    fontFamily: 'Roboto',fontStyle: 'normal',fontWeight: 'normal',fontSize: 18,lineHeight: 21,skipButton: {
    borderRadius: 20,backgroundColor: '#4F74F7',width: 81,height: 40,nextButton: {
    borderRadius: 20,buttonText: {
    fontFamily: 'Roboto',fontWeight: '700',fontSize: 15,lineHeight: 16,color: '#fff'
}
});

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?