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

488
Visualizações
How to change font size in the app on button click using React native

In my react native application I need to add + and - buttons in settings screen to increase or decrease the font size in the entire app when we click on those buttons from settings screen.Any help would be appreciated.

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

0

one way to make this is to create a state and update the fontsize on style

example:

const [fontSize, setFontSize] = useState(14);

    return (
      <p style={{fontSize: `${fontSize}px`}}>
         My text
      </p>
      <button onChange={() => setFontSize(fontSize + 1)}>More</button>
      <button onChange={() => setFontSize(fontSize - 1)}>Less</button>
    );

to make this you can set this fontSize at top level.

another way to make this is add any CSS lib and set the same state in a global CSS using the * on css

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