Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

165
Vistas
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 Respuestas
Responde la pregunta

0

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

verify ellipsizeMode

about 4 years ago · Juan Pablo Isaza Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda