react-native-cardview
react-native-cardview copied to clipboard
Negative Margin for children not working on android.
When I give a negative margin to a child view it works fine in iOS but in case of android its not working.
Same Problem Here
Can you give sample code and output screenshot here
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
I'm trying to make a toast component that will appear on top of the CardView. It works on IOS, but doesnt on Android.