1.0.10 • Published 7 years ago

react-native-dj-dialog v1.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

Dialog

accordion accordion

Install

npm i --save react-native-dj-dialog

Usage

Using in your app will usually look like this:

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';

import Dialog from 'react-native-dj-dialog';


export default class NPMTest extends Component {

  testDialog(){
    //测试一
    // this.refs.dialog.show("确定删除吗");
    // <Dialog ref="dialog" callback={()=>{alert('I am deleted!')}}  isRnNav='true'/>

    //测试二
    this.refs.dialog.show("我们都可以自定义样式,\n你了解了吗?","我是左边按钮","我是右边按钮");
    // <Dialog ref="dialog" callback={()=>{alert('I am deleted!')}} titleStyle={{fontSize: 14, color: "#333333", textAlign: 'center',lineHeight:20}} isRnNav='true'/>

  }

  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome} onPress={this.testDialog.bind(this)}>
          TestDialog press me!
        </Text>
        <Dialog ref="dialog" callback={()=>{alert('I am deleted!')}} titleStyle={{fontSize: 14, color: "#333333", textAlign: 'center',lineHeight:20}} isRnNav='true'/>
    </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
});

AppRegistry.registerComponent('xxx', () => NPMTest);

Props

The following props can be used to modify the style and/or behaviour:

PropTypeOpt/RequiredDefaultNote
isRnNavBooleanRequiredfalse是否正在使用RN导航,默认为false
titleStyleObjectOption{}标题样式
leftStyleObjectOption{}左边按钮样式
rightStyleObjectOption{}右边按钮样式
callbackfunctionRequired()=>{}右边按钮点击回调函数

Methods

The following methods can be used to open and close the Dialog:

MethodParametersNote
showtitle: 标题、left:左边按钮文案、right:右边按钮文案调起控件.
1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago