React-native-deck-swiper: Overlay behind image on Android

Created on 12 Mar 2018  路  2Comments  路  Source: alexbrillant/react-native-deck-swiper

I have an image on my card and the problem is, the overlays (Like, Nope, Super Like, Meh) are behind the image of the card.
This means, when swiping right,left,top or bottom the overlay will not appear. Only in the last millimeters, when the card lowers the opacity, the overlay is slightly visible. On iOS however, the overlay is on top of the image and is shown perfectly.
How can i solve this?

Most helpful comment

I was experiencing the same thing because I had rendered my cards with elevation on Android but did not include the style property in the overlay label wrapper. The solution is simply to add an elevation that is greater than or equal to the elevation of the card:

<Swiper
  ...
  renderCard={(card) => <View style={{elevation: 5, ...}}>...</View>}
  overlayLabels={{
    left: {
      title: 'Nope',
      style: {
        ...
        wrapper: {
          elevation: 5,
          ...
        }
      }
    }
  }, ...}
/>

@webraptor When attempting to resolve this through overlayLabelWrapperStyle, the label appeared above the card and pushed it downward!
@Jingo91 If this solves your problem, please close this issue.

All 2 comments

Of the top of my head there's some zIndex or something in your styles that causes this. Perhaps if you share your code and styles we could help.

I was experiencing the same thing because I had rendered my cards with elevation on Android but did not include the style property in the overlay label wrapper. The solution is simply to add an elevation that is greater than or equal to the elevation of the card:

<Swiper
  ...
  renderCard={(card) => <View style={{elevation: 5, ...}}>...</View>}
  overlayLabels={{
    left: {
      title: 'Nope',
      style: {
        ...
        wrapper: {
          elevation: 5,
          ...
        }
      }
    }
  }, ...}
/>

@webraptor When attempting to resolve this through overlayLabelWrapperStyle, the label appeared above the card and pushed it downward!
@Jingo91 If this solves your problem, please close this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

georgeMorales picture georgeMorales  路  4Comments

KoheiTigers picture KoheiTigers  路  7Comments

MindRave picture MindRave  路  9Comments

QQizi picture QQizi  路  4Comments

clay-morgan picture clay-morgan  路  4Comments