Issue
I have the following code:
// components
<ScrollView contentContainerStyle={styles.contentContainer}>
<SafeAreaView style={styles.container}>
<Dashboard></Dashboard>
<MainBottomNavBar></MainBottomNavBar>
</SafeAreaView>
</ScrollView>
// styles
contentContainer: {
flexGrow: 1,
},
container: {
marginTop: Platform.OS === 'android' ? StatusBar.currentHeight : 0,
flex: 1,
alignItems: 'center',
},
The scroll works perfectly on ios real device, but when I try to scroll on Android emulator - the scroll doesn't happen. However, when I reload the app I see a little movement at the moment when the screen mounts. So that I guess that code is ok, but the problem is with Android Emulator. Any ideas on what I'm doing wrong? How to make it scrollable also on Android Emulator?
Solution
Android doesn't have the bounce feature, only iOS has it:
https://reactnative.dev/docs/scrollview#alwaysbouncevertical-ios
So the content of android will scroll only if the height is bigger than the container.
Answered By - Francesco Clementi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.