magicismight / react-native-root-modal

A pure JavaScript solution for react native`s modal component
MIT License
367 stars 56 forks source link

Possibility to have a default setup of the overlay (floating modal?) #1

Closed ahmed1490 closed 8 years ago

ahmed1490 commented 8 years ago

Is it possible to put the modal to have a default absolute positioned bottom value?

For eg: Alt text

Here the more options may slide up the modal a little more to reveal more options between the button the the text.

Wondering if react-native-root-modal is the right option for something complex like this. Or something else?

magicismight commented 8 years ago

I`m not sure I totally understand you. Is this what you want?

qq 20160222093423 qq 20160222093622

This can fix the modal at the bottom of screen. No matter what content in it.

<Modal style={{
        right: 40,
        bottom: 0,
        left: 40,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: 'rgba(58, 93, 15, 0.8)',
        overflow: 'hidden'
    }}>
...content here
</Modal>

It can do anything like using a <View /> component.

magicismight commented 8 years ago

A <Modal /> is a sibling element to the root element of APP. It is just something like this. Root element is the one you registered by using AppRegistry.registerComponent('xxx', Root).

<View style={{flex:1}}>
<Root></Root>
<Modal style={[{position: 'absolute'}, yourCustomStyle]}>
</Modal>
</View>