-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Doesn't show over Card component #167
Comments
Hi @Irfanwani What is a In theory if you place in your top level App.js they will be above everything. |
Hi @Irfanwani I see that you are using Expo, could you isolate some sample code in https://snack.expo.io to show me? So I could see what are you doing... |
https://snack.expo.io/@irfanwani/card This is just a demo of it. I am using it in my project which uses it just in a similar way as in this code.
|
OK @Irfanwani The problem it is the If you put elevation=0 in your Card:
You will see that FlashMessage will shown corrected even in Android. Other solution it's to put FlashMessage inside another View/container that have a elevation value greater than elevation of Card: const MyComponent = () => (
<View style={{marginTop: 30}}>
<Card style={{ margin: 30 }} elevation={10}>
<Card.Title
title="Card Title"
subtitle="Card Subtitle"
left={LeftContent}
/>
<Card.Content>
<Title>Card title</Title>
<Paragraph>Card content</Paragraph>
</Card.Content>
<Card.Cover source={{ uri: 'https://picsum.photos/700' }} />
<Card.Actions>
<Button>Cancel</Button>
<Button onPress={() => show()}>Ok</Button>
</Card.Actions>
</Card>
<View style={{ position: "absolute", top: 0, left: 0, right: 0, zIndex: 1000 }} elevation={11}>
<FlashMessage position='top' />
</View>
</View>
); What do you think? |
You are right. But what if i wanted to use the elevation. without elevation, for me there is no point of using the card. I am using it for its styles including elevation. It would be better to find a better solution for it. Thanks! |
Not closing this issue, in case some one comes with a better general solution. |
I think i found a better solution. I wrapped the Also, i have to add some more styles like
Infact, we should keep the elevation much higher for the FlashMessage card so that it will always come on the top |
Flash messages are not showing over a card component but are hiding under it.
The text was updated successfully, but these errors were encountered: