react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

Shadow not stacking properly

Open greatwitenorth opened this issue 7 years ago • 3 comments

Environment

iOS Simulator expo: 32.0.0 react: 16.5.0 react-native-paper: 2.15.2

Description

I currently have a searchbar at the top of my app followed by a scroll view below. The searchbar is set to elevation 2 to show a slight drop shadow. When the list below is scrolled up, the items correctly scroll behind the searchbar, but the searchbar's shadow disappears as seen in the image below:

Screenshot 2019-05-06 10 30 15

Reproducible Demo

This is what I currently have in my home screen:

<View style={styles.container}>
    <View style={{flexDirection: "row", marginLeft: 10, marginRight: 10, position: "relative"}} >
        <Searchbar
            style={{flex: 1, elevation: 2}}
            placeholder="Search Collection"
            onChangeText={query => {
                this.setState({query});
            }}
            value={query}
        />
    </View>
    <ScrollView contentContainerStyle={styles.contentContainer}>
        <GameListing
            image={"https://picsum.photos/400/400"}
            title={"Thing"}
            year={"2017"}
        />
        <GameListing
            image={"https://picsum.photos/400/400"}
            title={"Thing 2"}
            year={"2018"}
        />
    </ScrollView>
</View>

greatwitenorth avatar May 06 '19 15:05 greatwitenorth

Try adding some padding to searchBar's parent View.

iyadthayyil avatar May 06 '19 16:05 iyadthayyil

That seems to help, but I don't see the list item moving below the shadow since the View is now padded 5px down:

collection

greatwitenorth avatar May 06 '19 17:05 greatwitenorth

Absolutely position the search bar and add some top margin to your list. This is not an issue paper, it's because views are clipped on Android in RN.

satya164 avatar May 06 '19 18:05 satya164