Skip to content

[Android] Elevation inside a FlatList doesn't work #16431

@axredstudio

Description

@axredstudio

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS Sierra 10.12.6
Node: 8.6.0
Yarn: 1.1.0
npm: 5.4.2
Watchman: 4.9.0
Xcode: Xcode 9.0 Build version 9A235
Android Studio: 2.3 AI-162.3871768

Packages: (wanted => installed)
react: 16.0.0-beta.5 => 16.0.0-beta.5
react-native: 0.49.1 => 0.49.1

Target Platform: Android 8.0.0/7.0.0

Steps to Reproduce

Having a shadow inside a flat list(in footerComponent, headerComponent, emptyListComponent and Item) using elevation for android shows nothing, while using shadow props for iOS works perfectly.

Expected Behavior

There should be a shadow in android.

Actual Behavior

No shadow is shown.

Reproducible Demo

renderItem = ({ item }) => {
    return (
        <View style={{
            shadowColor: '#000',
            shadowOffset: { width: 0, height: 2 },
            shadowOpacity: 0.1,
            shadowRadius: 1.5,
            elevation: 3,
            borderWidth: 1,
            borderColor: '#ccc',
            flex: 1,
            height: 42,
            backgroundColor: '#fff',
        }} />
    );
}

render() {
    return (
        <FlatList
            data={this.props.data}
            keyExtractor={item => item.id}
            renderItem={this.renderItem}
        />
    );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions