Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

210
Visualizações
Changing height of Header in React Native Stack Navigator doesn't work

I am trying to change the style of the header of a Stack Navigator and everything works fine except the height property. I am also nesting the Stack Navigator inside a Drawer Navigator. When I change the height of its header, everything works fine.

I tested it on my AVD and iPhone with Expo Go and it doesn't work. In the web browser, it works fine.

Both headers should have the same height (150px)
enter image description here

Drawer:

import React from "react";
import { createDrawerNavigator } from "@react-navigation/drawer";
import { NavigationContainer } from "@react-navigation/native";

import HomeStack from "./HomeStack";
import AboutStack from "./AboutStack";

const DrawerNavigator = createDrawerNavigator();

export default function Drawer() {
    return (
        <NavigationContainer>
            <DrawerNavigator.Navigator
                screenOptions={{
                    headerShown: true,
                    headerStyle: {
                        height: 150,
                    },
                }}
            >
                <DrawerNavigator.Screen name="HomeStack" component={HomeStack} />
                <DrawerNavigator.Screen name="AboutStack" component={AboutStack} />
            </DrawerNavigator.Navigator>
        </NavigationContainer>
    );
}

AboutStack:

import React from "react";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import About from "../screens/About";

const Stack = createNativeStackNavigator();

export default function AboutStack() {
    return (
        <Stack.Navigator
            screenOptions={{
                headerStyle: {
                    height: 150,
                    backgroundColor: "#111",
                },
                headerTintColor: "#fff",
            }}
        >
            <Stack.Screen
                name="About"
                component={About}
                options={{
                    title: "About GameZone",
                }}
            />
        </Stack.Navigator>
    );
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can use this documentation https://reactnavigation.org/docs/headers/ .Also you can try

headerTitleStyle: {
            fontWeight: 'bold',
          }, 

for that purpose .

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda