1.3.3 • Published 2 years ago

react-native-uialert v1.3.3

Weekly downloads
108
License
-
Repository
-
Last release
2 years ago

React-Native-UIAlert

案例 案例

Props属性说明

nametypeDefaultExtra
myDataDictionary{}控制显示内容
idStringnul按钮事件回调时区分那个按钮
textString""提示窗口的内容文案
buttonsArray[]两个维度的按钮多行多列:[[],[],[]],多行单列:[{},{},{}]
clickBtnFunctionnull回调方法

使用说明

安装

npm install react-native-uialert --save

引入

import UIAlert from 'react-native-uialert'

Methods

  • showV()//显示(默认是隐藏的)
  • heiV()//隐藏
    //contentText 主体文案的style
	<UIAlert ref = "UIAlert" contentText = {{textAlign:'left'}} clickBtn = {( id, backData )=>{
        //id==myData.buttons.item中的,backData则是showV()传入的数据
    }}/>

    /****
   * 
   * buttons : [item,[item,item,item]]//内部可以是oject()或者array(一行多个)
   * 
   * item : {
   *      title : 按钮文案
   *      titleColor : 文字颜色
   *      backgroundColor : 按钮背景色
   *      id : 区分回调
   * }
   * 
   * 
   */
//this.refs.UIAlert.showV( myData, backData )
if (this.refs.UIAlert) {
  this.refs.UIAlert.showV( {
      title: "title",//通知标题
      text: "text",//内容
      buttons: [{
          title: "b1",
          titleColor: WHITE_COLOR,
          backgroundColor: YELLOW_COLOR,
          id:1,
        },[{
          title: "b1",
          titleColor: WHITE_COLOR,
          backgroundColor: YELLOW_COLOR,
          id:1
        },{
          title: "b2",
          titleColor: WHITE_COLOR,
          backgroundColor: YELLOW_COLOR,
          id:2
      },{
          title: "b3",
          titleColor: WHITE_COLOR,
          backgroundColor: YELLOW_COLOR,
          id:2
      }]]
  } )
}

UIButton

属性说明

NameTypeDefaultExtra
nameString""按钮的文字
selectedBooleanfalse选择中或非选中按钮状态
tagIdidnull按钮的标识
stylesDictionary{}按钮的样式
onPressFunctionnull按钮触发返回tagId

使用

    import { UIButton } from 'react-native-uialert'
       <View style={{ margin:5, height:35, }}>
            <UIButton
                name={ title }
                tagId = {id}
                onPress={(tagId)=>{
                    this.cancel(tagId);
                }}
                styles={{
                    backgroundColor:backgroundColor,
                    borderRadius:5,
                    fontSize:12,
                    titleColor:titleColor
                }}
            />
        </View>
1.3.3

2 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.2

5 years ago

1.2.0

5 years ago

1.2.1

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.1

5 years ago

1.1.2

5 years ago

1.1.0

5 years ago

2.0.1

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago