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

162
Visualizações
Multiline Text in fixed View width - React Native?

In a Header component, I have a View that takes fixed width, and the text inside it is cut so I want to make this text to be like multiline,

text

I can't delete fixed width because it's dependent on another scrolling stuff.

const TAB_WIDTH = normalizeWidth(150);
<FlatList
            data={myRoutes}
            ref={headerRef}
            contentContainerStyle={{
              flexGrow: 1,
            }}
            keyExtractor={(item, index) => index.toString()}
            horizontal
            showsHorizontalScrollIndicator={false}
            renderItem={({item, index}) => (
              <View
                style={{
                  width: TAB_WIDTH,
                }}>
                <TouchableOpacity
                  onPress={() => scrollToActiveIndex(index)}
                  style={styles.headerItem}>
                  <Text
                    style={[
                      styles.labelStyle,
                      {
                        color:
                          activeIndex === index
                            ? buttonBgColor
                            : COLORS.menuText,
                      },
                    ]}>
                    {item.title}anas
                  </Text>
                </TouchableOpacity>
                {activeIndex === index && (
                  <View
                    style={[styles.headerBar, {backgroundColor: buttonBgColor}]}
                  />
                )}
              </View>
            )}
          />
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

you can use <Text numberOfLines={2}/>

verify ellipsizeMode

about 4 years ago · Juan Pablo Isaza Relatório

0

I also got the same error and I applied width to the text component like this

width: 'YOUR WIDTH'

You can apply this code

<Text style={[
   styles.labelStyle,
   {
       color: activeIndex === index ? buttonBgColor : COLORS.menuText,
       width: TAB_WIDTH
    },
]}>
   {item.title}anas
</Text>

If you find this helpful just comment me.

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