|
[建议]
maskView模块和UIAlert模块共存的情况下,安卓手机问题
[复制链接]
本帖最后由 张婉丽 于 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
-
ios
|