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

176
Visualizações
Override React navigation SearchBar to add Segmented Control

Is there a way to Override the header in react navigation with Search Bar and Segmented control using React navigation without writing a fully custom header? I want to use the inbuilt search component provided by react navigation but add a segmented control when search is tapped. Also want the native large title style in iOS.

React navigation has an option to specify Search Options which shows a SearchBar but I am not sure if I can override this functionality. Refer to screenshot below:

Search with Segmented control

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

the best I could do was

    React.useEffect(() => {
        navigation.setOptions({
            headerTitle: () => {
                return <SegmentedControl style={{ width: 200, alignSelf: 'center' }}
                    values={['One', 'Two']}
                    selectedIndex={selectedIndex}
                    onChange={(event) => setSelectedIndex(event.nativeEvent.selectedSegmentIndex)}
                />
            },
        });
    });

this replaces the small header title with a segmented control. header animations and search bar still work.

later edit: i just realized, this is the native behavior as well (you can check it on ios in the recents tab, on the call screen). the segements replace the small header title :)

result video

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