In React Native, how do I put a view on top of another view, with part of it lying outside the bounds of the view behind?

fatuhoku picture fatuhoku · Jun 28, 2015 · Viewed 151.9k times · Source

I'm trying to make a layout as per below with React Native.

enter image description here

How do I specify the position of B relative to A?

With iOS Interface Builder and autoconstraints, this can very explicitly be done and is a breeze. It's not so obvious how one might achieve this with React Native.

Answer

boredgames picture boredgames · Jun 29, 2015

Add the following style to the "floating" view:

position: 'absolute'

You may also need to add a top and left value for positioning.