root-two / react-native-drawer

React Native Drawer
MIT License
2.54k stars 391 forks source link

no elevation/shadow on android only #327

Open cmeehanSL opened 6 years ago

cmeehanSL commented 6 years ago

Hello,

I have managed to get the shadows fine on iOS but cannot get the elevation prop to work at all on android, seemingly having tried every combination:

Here is how it looks on both platforms: screen shot 2017-10-03 at 16 11 46 screen shot 2017-10-03 at 16 11 53

And here is the way I've arranged the styles:

const optionalDrawer = <View style={styles.cashpointDrawer}>
        <Drawer
            type={'overlay'}
            captureGestures={true}
            tapToClose={true}
            closedDrawerOffset={0.25}
            openDrawerOffset={0.2}
            styles={{drawer: styles.withdrawButtonOverlay}}
            side={'right'}
            acceptTap={true}
            negotiatePan={true}
            content={
              <TouchableHighlight underlayColor='white' onPress={invalidInput ? undefined : startWithdrawal}>
                  {withdrawOverlay}
              </TouchableHighlight>
              }>
            <TouchableOpacity onPress={invalidInput ? undefined : startNormal}>
              {button}
            </TouchableOpacity>

        </Drawer>
    </View>
withdrawButtonOverlay: {
    flex: 1,
    shadowOffset: {
      width: -5,
      height: 5
    },
    shadowColor: 'black',
    shadowOpacity: 0.5,
    elevation: 20
  }

Any help would be amazing!

Thanks

Jpadilla1 commented 6 years ago

This worked for me https://github.com/root-two/react-native-drawer/issues/101