不支持在 camera 组件中添加覆盖层吗,用于添加相机的拍摄按钮。模拟器可以显示覆盖物,而真机不显示。
<view class="camera" tt:if="{{camera && os}}">
<camera mode="normal" device-position="front" frame-size="large" flash="off"
resolution="high" style="width: {{os.windowWidth}}px; height: 100vh;">
<view class="facebox"
style="width:{{os.windowWidth * 0.7}}px; height:{{os.windowHeight * 0.5}}px; margin-left: {{os.windowWidth * 0.15}}px; margin-top:{{os.windowHeight * 0.2}}px;">
</view>
<!-- 相机拍照按钮 -->
<view class="camera-button" hidden="{{camerabutton}}" bind:tap="handleTakePhoto">
<image src="../images/takePhoto.png"></image>
</view>
</camera>
</view>