'How to show a floating image above the modal border in React native?

Is there any way to achieve this effect in react native? I have an image that is supposed to pop on top of the modal margin.

Floating Modal Image

Edit: I've already tried with position: 'absolute' and negative margin top or top but the image goes beneath the margin of the modal like this:

Image under Modal



Solution 1:[1]

Yes, use position: 'absolute' and negative top or marginTop. The image must have a transparent background.

Solution 2:[2]

You need to use zIndex.

here is a sample code that can help you.

https://snack.expo.dev/@asifiqubal/modal

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Abe
Solution 2 Asif Iqubal