ScrollView cosuming parent space entirely

24 views Asked by At

I am trying something with ScrollView but I found that no matter what the height is provided in style to ScrollView, it is occupying its parent entirely. What is the issue with ScrollView?

<View style={{ width: 200, height: 250 }}>
    <ScrollView style={{ width: '100%', height: 48, backgroundColor: 'purple' }} horizontal={false}>

    </ScrollView>
</View>

Its a sample code and scrollview takes space of 200 - 250 dimension. react-native: 0.59.8

1

There are 1 answers

1
Nikhil bhatia On

doing width: '100%' inside scrollview will cover full width of mobile phone

try to remove width: '100%'