|
UIAlert 模块封装了一些目前在 android & ios平台比较流行的对话框。
接口还在补充中。
文档地址:
https://docs.apicloud.com/Client-API/UI-Layout/UIAlert
效果图:
提醒1:图标可用2倍图,避免高清屏幕图片有锯齿。
提醒2:添加模块,编译自定义loader测试。
- var UIAlert = api.require('UIAlert');
- UIAlert.invite({
- data: {
- avator: 'widget://image/account.png',
- name: 'Jack Ma Ma MA',
- title: '高级上尉王者荣耀',
- description: '向你发起挑战……',
- duration: 15000, //单位ms
- tips: '倒计时结束...',
- leftBtnTitle: '拒绝',
- rightBtnTitle: '接受'
- },
- styles: {
- w: 340,
- h: 400,
- bgColor: '#FFF',
- avator: {
- size: 45,
- marginTop: 30,
- },
- name: {
- size: 14,
- color: '#1C86EE',
- marginTop: 5
- },
- title: {
- size: 20,
- color: '#4F4F4F',
- marginTop: 10,
- },
- description: {
- size: 20,
- color: '#000',
- marginTop: 10,
- },
- timer: {
- size: 100,
- progressNormalColor: '#EEEE00', //蓝色
- progressHightlightColor: '#DC143C', //灰色
- marginTop: 20,
- },
- tips: {
- size: 14,
- color: '#1C86EE',
- marginTop: 10
- },
- leftBtn: {
- w: 60,
- h: 40,
- color: '#FFF',
- size: 12,
- corner: 5,
- bgColor: '#DC143C'
- },
- rightBtn: {
- w: 60,
- h: 40,
- color: '#FFF',
- size: 12,
- corner: 5,
- bgColor: '#1C86EE',
- marginLeft: 40
- }
- }
- }, function(ret) {
- alert(JSON.stringify(ret));
- });
复制代码
|
本帖子中包含更多资源,您需要 登录 才可以下载或查看,没有帐号?立即注册
X
|