wx.createCameraContext()拍照时,安卓手机显示图片异常
发布于 5 年前 作者 leijie 15619 次浏览 来自 问答

安卓手机,拍摄照片后,显示图片发蓝,iOS正常

* 如何复现?代码如下

<!-- camera.wxml -->

<camera flash=“off” style=“width: 100%; height: 463rpx;”>

<cover-image style=“width:100%;height:100%;” src=’{{photo_path}}’></cover-image>

</camera>

<button type=“primary” bindtap=“takePhoto”>拍照</button>

takePhoto: function () {

    console.log(“开始拍照”);

    const ctx = wx.createCameraContext()

    ctx.takePhoto({

        quality: ‘normal’,

        success: (res) => {

            this.setData({

                photo_path: res.tempImagePath,

            })

            console.log(“拍摄成功”);

        },

        fail: function (e) {

            console.log(“拍摄失败”);

            console.log(e);

        }

    })

}

将高camera高度-1就正常了 height: 462rpx;

正常情况

1 回复

你好,这是一个已知问题,我们会在后续版本中进行修复,另外后续建议通过搜索相关关键字来后在提问,可以提高问题解答的效率。。

回到顶部