folofse / androw

Shadows in React Native for Android
97 stars 16 forks source link

Can just set the background View, not all the child views? #17

Closed hejun041 closed 4 years ago

hejun041 commented 4 years ago

Like the CardView,not all the items

folofse commented 4 years ago

Hi, I suspect that the children are not visible when the bitmap representation of the shadow get created, at the moment the parent gets rendered. I will look in to it.

hejun041 commented 4 years ago

In my case I use a View to be the first child ,like this: `<Androw style={[this.props.style, { backgroundColor: 'transparent' }]} >

{this.props.children}
        </Androw>`

And you can change the View to Touchable Component

folofse commented 4 years ago

Hi sorry for late feedback. It adds the shadow to the nearest child, so if a view is between it will recieve the shadow. I would reccomend you to add Androw on each child that should have the shadow, or in you case on each card.

In this example the shadow gets applied to the view instead of the which lies inside the view.

Screenshot 2020-01-16 at 08 59 50
hejun041 commented 4 years ago

thx a lot