简体   繁体   中英

ScrollView not working (only on android) reactnative

This is only happening for one of the custom components that I have created. This use to work but it randomly stopped. I have tried to move ScrollView in different parts of the function (before View , around Card ...) but I've had no success. The little scrollbar on the right hand side shows...you just can't scroll. But it works without any issues on iOS

I also tried to give View that wraps ScrollView flex: 1 but no success.

I'm running expo v42 using native base ^2.15.2

The component:

import React from 'react';
import { View, StyleSheet, Image, ScrollView } from 'react-native';
import propTypes from 'prop-types';


import { Card, CardItem } from 'native-base';


export default function ExerciseCard(props) {
    const { iconSource, iconType, customStyle, SVG } = props;
    return (

        <Card style={styles.Card}> // this is from native base

            <CardItem style={[styles.ExerciseCard, customStyle]}> // also native base
               //icon stuff
              // dynamic svg
                <View style={styles.TopToBottom}>
                  <ScrollView>
                        {props.children} // this can have bunch of text hence why I need to scroll through them
                  </ScrollView>
                </View>

            </CardItem>
        </Card >

I don't know if it can bring you a solution but I've already encountered this kind of issue, and I had to wrap the content in a touch component like touchableOpacity.

I think the issue depends on the layering / wrapping around the scrollview.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM