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

Negative Margin for children not working on android.

Open sandeepsingh91 opened this issue 4 years ago • 3 comments

When I give a negative margin to a child view it works fine in iOS but in case of android its not working.

sandeepsingh91 avatar Sep 10 '19 03:09 sandeepsingh91

Same Problem Here Screenshot_1568092248

arjunghimire avatar Sep 10 '19 05:09 arjunghimire

Can you give sample code and output screenshot here

Kishanjvaghela avatar Sep 10 '19 12:09 Kishanjvaghela

I have a similar issue, but with a child that positioning absolutely:

Code (modified Example3.js):

import React, { Component } from 'react'
import { StyleSheet, Text, View, SafeAreaView } from 'react-native'
import CardView from 'react-native-cardview'

export default class Example3 extends Component {
  render() {
    return (
      <SafeAreaView>
        <CardView
          cardElevation={3}
          cardMaxElevation={3}
          cornerRadius={3}
          style={styles.cardViewStyles}
        >
          <View style={styles.innerStyles}>
            <Text style={styles.textStyles}>Helloo</Text>
          </View>
        </CardView>
      </SafeAreaView>
    )
  }
}

const styles = StyleSheet.create({
  cardViewStyles: {
    height: 60,
    justifyContent: 'center',
    alignItems: 'center',
    margin: 20,
    backgroundColor: '#ffffff',
  },
  innerStyles: {
    flex: 1,
    justifyContent: 'flex-end',
    backgroundColor: 'red',
    position: 'absolute',
    top: -9,
    borderWidth: 3,
    borderColor: 'blue',
    zIndex: 100,
  },
  textStyles: {
    color: '#000000',
    fontSize: 12,
    backgroundColor: 'pink',
    textAlign: 'center',
  },
})

Screenshot

image


I'm trying to make a toast component that will appear on top of the CardView. It works on IOS, but doesnt on Android.

march213 avatar Nov 07 '19 23:11 march213