Modal 组件 react-native-modal

码农软件 · 软件分类 · 其他(Others) · 2019-07-21 06:59:03

软件介绍

react-native-modal 是 React Native 的 <Modal> 组件。

使用示例:

'use strict';
var React = require('react-native');
var Modal = require('react-native-modal');
var { AppRegistry, StyleSheet, View, Text } = React;
class App extends React.Component {
    constructor() {
        this.state = {
          isModalOpen: false
        };
    }
    openModal() {
        this.setState({isModalOpen: true});
    }
    closeModal() {
        this.setState({isModalOpen: false});
    }
    render() {
        return (
            <View style={styles.page}>
                <Text onPress={() => this.openModal()}>
                    Open Modal.
                </Text>
                <Modal isVisible={this.state.isModalOpen} onClose={() => this.closeModal()}>
                    <Text>Hello world!</Text>
                </Modal>
            </View>
        );
    }
}
var styles = StyleSheet.create({
    page: {
        flex: 1,
        position: 'absolute',
        bottom: 0,
        left: 0,
        right: 0,
        top: 0
    }
});
AppRegistry.registerComponent('App', () => App);


本文地址:https://codercto.com/soft/d/10592.html

The Science of Programming

The Science of Programming

David Gries / Springer / 1989-4-21 / USD 99.00

Describes basic programming principles and their step-by- step applications.Numerous examples are included.一起来看看 《The Science of Programming》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具