收藏
回答

camera和cover-view 层级问题?

想实现一个类似原声相机的拍摄功能 给上半部分和下半部分设置了遮罩层 运行完发现

在开发者工具中 cover-view可以覆盖camera 但是切换到真机调试 会先渲染下cover-view 然后再出来camera camera把cover-view覆盖了 这个有人能帮忙解决下吗

开发者工具中的效果

真机调试中却是这样



尝试过好多解决方案 把cover-view挪到camera同级也不好使

<camera class="camere_main" :device-position="cameraPosition" flash="flash" binderror="error" :style="{ width: cameraWidth + 'px', height: cameraHeight + 'px' }">
			<cover-view class="camere_in" :style="{ height: cameraHeight + 'px' }">
				<cover-view class="camere_up"></cover-view>
				<cover-view class="camere_down"></cover-view>


				<!-- <button @click="startRecord">拍摄</button>
				<button @click="stopRecord">停止</button> -->
			</cover-view>
		</camera>

css

.camere_in {
	position: relative;
	.camere_up {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 262rpx;
		background-color: #000;
		z-index: 1;
	}
	.camere_down {
		position: absolute;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 402rpx;
		background-color: #000;
		z-index: 1;
	}
}
回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容