brentvatne / react-native-overlay

An <Overlay /> component that brings content inside to the front of the view regardless of its current position in the component tree.
638 stars 79 forks source link

Overlay child height is based on owner, not overlay #21

Open ChristianKohler opened 9 years ago

ChristianKohler commented 9 years ago

Layout

Phone height: 480 First block height: 100 Second block height: 380

+-----------------------------------------------+
|          height: 100                          |
|-----------------------------------------------|
|                                               |
|             flex: 1                           |
+-----------------------------------------------+

JSX

<View style={styles.container}>
    <View></View>
    <View>
        <LoadingOverlay />
    </View>
</View>

Expected

LoadingOverlay height = 480

Actual

LoadingOverlay height = 380 (same as owner view)

Example: https://rnplay.org/apps/_j9F_A/edit

niftylettuce commented 8 years ago

@ChristianKohler Is this still an issue? Did you go with an alternative? If you didn't, what was your fix?

ChristianKohler commented 8 years ago

@niftylettuce yes, still an issue. See: https://rnplay.org/apps/XcsRrQ

niftylettuce commented 8 years ago

@ChristianKohler yeah I just have the same issue here while integrating this, I wonder how we can fix...

niftylettuce commented 8 years ago

@ChristianKohler Perhaps we need to look at this?...

If you compare the code here https://github.com/brentvatne/react-native-overlay/blob/master/RNOverlay.m#L70 to the code here https://github.com/Paldom/SpinnerDialog/blob/master/src/ios/CDVSpinnerDialog.m#L51 that uses rectForView I think we need to use bounds differently?

niftylettuce commented 8 years ago

actually it's probably this _overlayViewController.view = _overlayBaseView; the base view controller is not getting defined properly, maybe the traversal thing is broken

niftylettuce commented 8 years ago

See #36 - we will be refactoring this soon to support Android/iOS and not have any issues here, there will no longer be the XCode integration needed