Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

164
Views
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 answers
Answer question

0

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

verify ellipsizeMode

about 4 years ago · Juan Pablo Isaza Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!