brentvatne / stargrave-0

preserving my stars for vanity. former home of react-native-modal
389 stars 65 forks source link

Full screen with UINavigationBar outside of ReactView #22

Closed jessepollak closed 9 years ago

jessepollak commented 9 years ago

I'm trying to use the modal and have it go full screen. Unfortunately, I have a UINavigationBar outside of the ReactView which is causing problems. It seems as though it is taking the size of the ReactView rather than the main view.

screenshot 2015-05-21 12 35 13

Any ideas on how to approach this issue?

brentvatne commented 9 years ago

@jessepollak - does this happen with forceToFront enabled?

jessepollak commented 9 years ago

Yep, when forceToFront isn't enabled, it looks like this.

screenshot 2015-05-21 13 07 12

Iliker commented 9 years ago

+1 when forceToFront={true}, it looks like this. 2015-05-22 2 37 30

brentvatne commented 9 years ago

Thanks for the reports guys! I'll try to take care of these this weekend

grabbou commented 9 years ago

It's probably because of the React calculating absolute positions relative to the parent view, not to the UIWindow the element has been attached to. Not sure if coming straightly from React (that would've been super weird) or from Overlay, probably needs some investigating, but below is my tip that made it working.

Copy the Styles.js from this repo, define them in your project and change the container part to this one:

import Dimensions from 'Dimensions';

export default StyleSheet.create({
  width: window.width,
  height: window.height,
  position: 'absolute',
  left: 0,
  top: 0
});

@brentvatne if this is something you are happy with, I can submit a PR.

brentvatne commented 9 years ago

@grabbou - I like it - let's do it :smile:

grabbou commented 9 years ago

@brentvatne to the native-modal repo? (this one)

brentvatne commented 9 years ago

@grabbou - fair question, probably both actually (Overlay and here)

grabbou commented 9 years ago

I'll check out Overlay stuff and see if this is something that we can fix there and will work out of the box or not.

ghost commented 9 years ago

@grabbou I tried your fix on react-native-overlay. It seems to does the trick :) thanks