0

I have the following code:

 <View style={{ backgroundColor: 'black'}}>
            <ArticleSwipable
                ref={swipeableRef}
                renderRightActions={this.renderRightActions}
                onSwipeableClose={() => console.log('close')}
                onSwipeableOpen={loadArticleSwipe}
                onSwipeableWillOpen={() =>{ setzIndex(100); }}>
                <ArticleScreen
                    article={article}
                    navigation={navigation}
                    scrollRef={scrollRef}
                    header={<Header
                        onFavouritePress={toggleFavouriteButton}
                        favouriteButtonIcon={favouriteButtonIcon} />} 
                    isLoading={isLoading}/>
            </ArticleSwipable>
            <LoadingComponent opacity={loadingFadeAnim} zIndex={zIndex} isLoading={isLoading} />
        </View>

where ArticleSwipable is a react-native-gesture-handler/Swipable component but with overridden close method. ArticleScreen has the following structure:

<View>
   <ScrollView>...</ScrollView>
</View>

My goal is to make the Swipeable Component take the entire screen but now if the content is less than the height of the screen will display the white rectangle at the bottom. Example

If the content is bigger than the height of the screen then everyting is ok.

How can I get rid of the white rectangle at the bottom?

1 Answers1

0

Try this once :

<View style={{ backgroundColor: 'black' ,flex:1}}>
            <ArticleSwipable
                ref={swipeableRef}
                renderRightActions={this.renderRightActions}
                onSwipeableClose={() => console.log('close')}
                onSwipeableOpen={loadArticleSwipe}
                onSwipeableWillOpen={() =>{ setzIndex(100); }}>
                <ArticleScreen
                    article={article}
                    navigation={navigation}
                    scrollRef={scrollRef}
                    header={<Header
                        onFavouritePress={toggleFavouriteButton}
                        favouriteButtonIcon={favouriteButtonIcon} />} 
                    isLoading={isLoading}/>
            </ArticleSwipable>
            <LoadingComponent opacity={loadingFadeAnim} zIndex={zIndex} isLoading={isLoading} />
        </View>

And also this :

<View style={{flex:1}} >
   <ScrollView>...</ScrollView>
</View>
Gaurav Roy
  • 11,175
  • 3
  • 24
  • 45