zl程序教程

您现在的位置是:首页 >  工具

当前栏目

react-native自定义对话框弹出框组件dialogs

组件React 自定义 native 对话框 弹出
2023-09-27 14:28:59 时间

介绍:http://www.jianshu.com/p/076ca28f7012

这是一款结合了alert弹出框与confirm弹出框综合的一款组件,可以定义参数改变弹出框的样式以及点击事件等

展示:


使用代码:





自定义参数:

/**

* animationType:动画类型 使用Modal组件 ’none,fade,slide‘  ---string

* title:头部标题文字                ---string

* thide:true|false 是否隐藏头部    ---boolean

* headStyle:头部样式                ---object

* messText:中间提示文字            ---string

* clickScreen:点击屏幕是否隐藏弹出框 ---boolean

* innersWidth:弹出框的宽度  ---number

* innersHeight:弹出框的高度 ---number

* buttons:按钮数组          ---array

* buttons:[

* {

* txt:'按钮文字',    ---string

* btnStyle:{backgroundColor:'transparent'}, 按钮的样式对象---object

* txtStyle:{color:'#ff6600'},    按钮的文字样式          ---object

* onpress:this.cancels.bind(this) 按钮的点击事件          ---function

* }

* ...

*        ]

*/

事件:

show(options):显示

hide(): 隐藏

详细使用方法https://github.com/antiantian/CommonDialog