I am using ScrollView for scrolling the list how can i make it horizontal it is appearing vertical
I also tried wrapping up in different views but its not working
for eg:
<View> <ScrollView> . . . </ScrollView> <View>
In the ScrollView, we can scroll the components in both direction vertically and horizontally. By default, the ScrollView container scrolls its components and views in vertical. To scroll its components in horizontal, it uses the props horizontal: true (default, horizontal: false).
React native ScrollView component comes with a property to make one ScrollView horizontal. This prop is horizontal By default, it's value is false i.e. by default, we got one vertical ScrollView. We can convert it to a horizontal ScrollView by marking it false.
You need to define that you want to active horizontal in scrollview
<View> <ScrollView horizontal={true} > . . . </ScrollView> <View>
that may be help you
horizontal={true}
prop to the ScrollView
Component.By default, ScrollView
is laid out vertically. In order to scroll the content horizontally, you simple need to pass a horizontal={true}
prop to the ScrollView
Component, like so:
<ScrollView horizontal={true}> <Text>Child 1</Text> <Text>Child 2</Text> <Text>Child 3</Text> </ScrollView>
The above code will lay out Child 1, Child 2 and Child 3 horizontally instead of vertically.
You can read more on the official React Native docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With