<camera id="myCamera" class="camera" style="display:{{cameraDisplay}};height:{{cameraHeight}}px" device-position="back" flash="auto" >
<cover-view class="container" style="height:{{cameraHeight}}px">
<cover-view class="pause" bindtap="pause">
<cover-image class="img" src="../../images/icon.png" />
</cover-view>
</cover-view>
</camera>
-------------------------------------------------------------------------------------------
const cameraContext = wx.createCameraContext('myCamera');
Page({
data:{
cameraDisplay: 'block',
cameraHeight:1000,
},
pause:function(){
let that = this;
that.setData({
cameraDisplay: 'none',
cameraHeight:0,
});
cameraContext.takePhoto({
success: function (res) {
console.log(res);
},
})
})
网友回复:
收到,我们看看。你这边试试hidden属性可以不?
只有camera中的cover-view cover-image 会被隐藏掉,但是camera还是显示的
<camera id="myCamera" hidden="hidden" class="camera" style="display:{{cameraDisplay}};height:{{cameraHeight}}px;visibility={{cameraHidden}}" device-position="back" flash="auto" >
<cover-view class="container" style="height:{{cameraHeight}}px;width:750rpx;">
<cover-view class="pause" bindtap="pause">
<cover-image class="img" src="../../images/icon_pause.png" />
</cover-view>
</cover-view>
</camera>
你好,问题已复现,我们会尽快进行修复。
目前可通过left: -999px等方式隐藏
好的