Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How react native scroll text?

Tags:

react-native

How react native scroll text?

I have a long text in a fixed height container. I want to show a part of text in that container and scroll it when I want to see more.

I have try overflow scroll but react native seems not support overflow scroll.

Thanks.

like image 917
kenny Avatar asked Dec 18 '22 15:12

kenny


2 Answers

You can use ScrollView for this case. Just put your text inside it and set height to scroll view.

like image 94
Александр Лунев Avatar answered Feb 23 '23 07:02

Александр Лунев


I'm used the following code. Take ScrollView and put your any element inside ScrollView.

render() {
    return(
      <View style={styles.container}>

       <ScrollView>       

         <Text>
           Add your text
         </Text>      

       </ScrollView>

      </View>
    );
  }
like image 30
Manish Ahire Avatar answered Feb 23 '23 06:02

Manish Ahire