Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative Margin for children not working on android. #56

Open
sandeepsingh91 opened this issue Sep 10, 2019 · 3 comments
Open

Negative Margin for children not working on android. #56

sandeepsingh91 opened this issue Sep 10, 2019 · 3 comments

Comments

@sandeepsingh91
Copy link

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

@arjunghimire
Copy link

Same Problem Here
Screenshot_1568092248

@Kishanjvaghela
Copy link
Owner

Can you give sample code and output screenshot here

@march213
Copy link

march213 commented Nov 7, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants