ScrollView
is a generic scrollable container where you can put multiple components and views, and these components do not need to be of the same type. ScrollView not only scrolls vertically, but also scrolls horizontally ( horizontal
set by properties).
Import React, {Component} from ' React '; import{appregistry, ScrollView, Image, Text, View} from ' React-native ' class ISc Rolleddownandwhathappenednextshockedme extends Component {render () {return (<Scrollview><Textstyle={{Fontsize:96}}>scroll me plz</Text><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><Textstyle={{Fontsize:96}}>if</Text><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><Textstyle={{fontsize:96}}>scrolling down</Text><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><Textstyle={{Fontsize:96}}>what ' s the best</Text><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><Textstyle={{fontsize:96}}>framework around?}</Text><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><ImageSource={Require ('./img/Favicon.png ')}/><Imagesource={require (' <image source={require (' <text style={{fontsize:80}}>react Native</text> </ scrollview>); }}//Registration Application (registercomponent) to render correctly//NOTE: Only the application is registered once as a whole, not each component/module is registered appregistry.registercomponent (' Iscrolleddownandwhathappenednextshockedme ', () = Iscrolleddownandwhathappenednextshockedme);
ScrollView
Suitable for displaying a very large number of scrolling elements. ScollView
all components placed in will be rendered, even if some components are extruded out of the screen because the content is too long. If you need to display a longer scrolling list, you should use components that are similar in functionality but better in performance ListView
. Let's take a look at how to use the ListView.
React native ScrollView