帖子
帖子
用户
博客
课程
12下一页
返回列表 发新帖
显示全部楼层
132
帖子
2
勋章
299
Y币

[建议] maskView模块和UIAlert模块共存的情况下,安卓手机问题

[复制链接]
发表于 2022-6-24 11:20:25
本帖最后由 张婉丽 于 2022-6-24 13:45 编辑

maskView模块和UIAlert模块共存的情况下,安卓手机maskView模块openMaskView方法写的内容在UIAlert模块UIAlert.popImage弹出的图下面,ios是在上面的,安卓有什么参数能设置吗让maskView这个模块的内容也在上面吗 代码如下:
目前ios和android的效果如下面图片:
maskView模块写的是上面那行文本,UIAlert模块写的是整个心形的礼物动画(占满整个屏幕),这两个效果是任意页面都可以同时弹出来
    function alertGift() {
        var UIAlert = api.require('UIAlert');
        UIAlert.popImage({
            imagePath: img.png,
            imageW: api.winWidth,
            imageH: api.winHeight,
           //  showAPNG: true,
            mask: 'rgba(0,0,0,.3)'
        }, function (ret) {
            // alert(JSON.stringify(ret));
            if (ret.eventType == 'show') {
                alertTxt('哈哈哈哈');
                setTimeout(function () {
                    UIAlert.close();
                    var demo = api.require('maskView');
                    demo.closeMaskView(function (ret, err) {
                        // alert(JSON.stringify(ret));
                    });
                }, 5000);
            }
        });
    }

    function alertTxt(txt) {
        var demo = api.require('maskView');
        var maskWidth = api.winWidth - 100;
        demo.openMaskView({
            rect: {
                x: 0,
                y: 0,
                h: api.winHeight,
                w: api.winWidth,
            },
            background: 'rgba(0, 0, 0, 0)',
            alpha: 0,
            animationType: 4,
            styles: [{
                x: 50,
                y: 50,
                h: 30,
                w: maskWidth,
                type: 'autoText',
                text: txt,
                textSize: 14,
                gravity: 0, //0 中间 1 : left 2 :right
                vertical: 1,//0:top 1:middle 2:bottom (垂直)
                textColor: '#fff',
                backgroundColor: '#FF0000',
                // backgroundColor: 'rgba(247,79,132,1)',
                radius: 15,
                isSingleLine: false,
                cornerTopLeft: true,//左上角为圆角(仅text、autoText有效)
                cornerTopRight: true,// 右上角为圆角(仅text、autoText有效)
                cornerBottomLeft: true,// 右下角为圆角(仅text、autoText有效)
                cornerBottomRight: true,// 右下角为圆角(仅text、autoText有效)
            }]
        }, function (ret, err) {
            // console.log(JSON.stringify(ret));
        });
    }

android

android

ios

ios
380
帖子
4
勋章
6
Y币
后打开openMaskView 什么效果?

用一个模块看能不能实现效果。
132
帖子
2
勋章
299
Y币
一个模块实现不了整个效果
技术咨询-F · 2022-6-24 11:37后打开openMaskView 什么效果?

用一个模块看能不能实现效果。
380
帖子
4
勋章
6
Y币
后调用UIAlert ,它也没显示到最上面 ?
张婉丽 · 2022-6-24 13:46一个模块实现不了整个效果
132
帖子
2
勋章
299
Y币
嗯 我后调用maskView模块并延迟了2s,文本描述那块还是显示在下方,文本是用的maskView模块,礼物动效是UIAlert模块
技术咨询-F · 2022-6-24 13:59后调用UIAlert ,它也没显示到最上面 ?
380
帖子
4
勋章
6
Y币
可尝试都使用弹窗alert模块实现。
132
帖子
2
勋章
299
Y币
UIAlert和dialogbox模块 弹框都是默认在屏幕中间 不满足要求,UIButton模块只能出现在代码所在的页面,无法全部页面都能显示
技术咨询-F · 2022-6-24 16:05可尝试都使用弹窗alert模块实现。
380
帖子
4
勋章
6
Y币
。。我反馈一下,看能不能增加接口
张婉丽 · 2022-6-24 16:27UIAlert和dialogbox模块 弹框都是默认在屏幕中间 不满足要求,UIButton模块只能出现在代码所在的页面,无法全部页面都能显示
132
帖子
2
勋章
299
Y币
嗯嗯 多谢多谢~
技术咨询-F · 2022-6-24 16:33。。我反馈一下,看能不能增加接口
后续关注一下发版公告
12下一页
您需要登录后才可以回帖 登录

本版积分规则