Alan1988
Alan1988
  • 发布:2015-08-21 11:24
  • 更新:2015-12-09 13:06
  • 阅读:1931

图片预览问题

分类:MUI

还有一个问题请问下,我的页面是有下拉刷新的,子页面里有图片预览,点击出现大图的时候怎样让图片预览把父页面也覆盖(父页面上是有头部和底部),图片预览时不能覆盖头部和底部,我现在用 setStyle 设置子页面的位置,但是Android 没效果,请问下怎么解决

2015-08-21 11:24 负责人:无 分享
已邀请:
DCloud_UNI_CHB

DCloud_UNI_CHB

不能覆盖头部和底部?你是webview模式选项卡+下拉刷新?

如果是多webview的话,目前确实没有实现跨webview覆盖,这个我们再想想办法吧

  • wujianfeng

    这个问题现在还是没有办法解决嘛?我们好多用户都是这个情况啊,基本我们都是有子页面的,但不能全屏预览 这个效果比较差

    2016-02-01 09:22

Alan1988

Alan1988 (作者)

是的,4个子页面公用的头部底部父页面,ios目前用setStyle({top:'0px',bottom:'0px'});暂时可以解决,但是Android貌似没效果,是不支持吗?谢谢DCloud_MUI_CHB

DCloud_UNI_CHB

DCloud_UNI_CHB

Android目前不支持,确认为Android平台的bug;

  • Alan1988 (作者)

    好的,非常感谢!

    2015-08-21 13:52

gengjun

gengjun

最新版本的可以通过设置 webviewstyle 来解决
更改mui.previewimage.js文件 如下

    proto.open = function(index, group) {  
        /**  
         *gengjun  
         */  
        plus.webview.currentWebview().setStyle({  
                top: 0,  
                bottom: 0,  
                bounce: 'vertical'  
        });  
        if (this.element.classList.contains($.className('preview-in'))) {  
            return;  
        }  
        if (typeof index === "number") {  
            group = group || defaultGroupName;  
            this.addImages(group, index); //刷新当前group  
            this.openByGroup(index, group);  
        } else {  
            group = index.getAttribute('data-preview-group');  
            group = group || defaultGroupName;  
            this.addImages(group, index); //刷新当前group  
            this.openByGroup(this.groups[group].indexOf(index.__mui_img_data), group);  
        }  
    };  
    proto.close = function(index, group) {  
        /**  
         *gengjun   
         */  
        plus.webview.currentWebview().setStyle({  
                top: '45px',  
                bottom: 0,  
                bounce: 'vertical'  
        });

该问题目前已经被锁定, 无法添加新回复