Reputation: 33
so i'm just simply trying to get ScrollView to work on React Native Android emulator Pixel running Android 6.0.0. i'm using as basic of an app as i can and nothing will scroll.
import React, { Component } from 'react';
import {
AppRegistry,
Text,
View,
ScrollView,
Dimensions,
} from 'react-native';
const screenHeight = Dimensions.get('window').height
export default class scrollTest extends Component {
render() {
return (
<View>
<ScrollView>
<Text>HELLO WORLD</Text>
<Text>HELLO WORLD</Text>
<Text>HELLO WORLD</Text>
<Text>HELLO WORLD</Text>
<Text>HELLO WORLD</Text>
<Text>HELLO WORLD</Text>
</ScrollView>
</View>
);
}
}
AppRegistry.registerComponent('scrollTest', () => scrollTest);
I have exhausted every option i could think of. i set flex: 1 in the main View, made ScrollView the main view and wrapped the Text in a view, wrapping the text just in a plain view, passing a vertical={true} into ScrollView, passing flex: 1 to both ScrollView and View, and nothing seems to work. I thought this was a flaw of the emulator and decided to test it on a Samsung Galaxy S5 running Android 6.0.0 but the same issue was there as well.
is there any way to get ScrollView working on Android or is it just broken? Are there any workarounds?
Upvotes: 0
Views: 2537
Reputation: 455
Maybe you can try something like this and see if it is still scrolling problem.
export default class scrollTest extends Component {
render() {
return (
<View>
<ScrollView>
{
Array(50).fill(0).map(index =>
<Text>HELLO WORLD</Text>
)
}
</ScrollView>
</View>
);
} }
Upvotes: 2