Skip to content

devWayne/react-native-overlay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-overlay


Usage

'use strict';

var React = require('react-native');
var Overlay = require('./overlay');
var { AppRegistry, StyleSheet, View, Text } = React;

var  YApp  = React.createClass({
  getInitialState() {
      return {
        isOverlayOpen: true
      }
    },

  closeOverlay() {
    this.setState({isOverlayOpen: false});
  },

  render() {
    return (
      <View style={styles.page}>
 	<Overlay onPressBackdrop={this.closeOverlay} isVisible={this.state.isOverlayOpen} Opacity={0.5}/>
      </View>
    );
  }
});

var styles = StyleSheet.create({
  page: {
    flex: 1,
    position: 'absolute',
    bottom: 0,
    left: 0,
    right: 0,
    top: 0
  }
});

AppRegistry.registerComponent('App', () => App);

##API

Overlay props

name type default description
onPressBackdrop Function noop 点击Overlay触发的回调函数
isVisible Boolean true 是否显示Overlay
Opacity Int 0.5 Overlay透明度

MIT Licensed

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published