camera相机组件不支持添加覆盖物吗
46 浏览2025年03月18日作者:antxu

不支持在 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>
最后一次编辑于 2025 年 03 月 18 日
共 2 条评论

相关问答

专题推荐

热门文章

热门问答