如何在 map 组件上显示用户头像
发布于 4 年前 作者 hsu 14157 次浏览 来自 问答

根据文档,想要实现在 map 组件上显示内容只能使用 cover-view 和 cover-image ,但除了 button 组件均不能嵌套,所以无法嵌套 open-data 组件。

有没有什么好的解决方案,请教大家

1 回复

用这个方法试试:

wxss文件中添加:

.mapmask {

  position:fixed;

  top: 3rem;

  left: 0;

  bottom: -1;

  right: 0;

  z-index: 1000;

  background-color: rgba(255, 255, 255, 1)

}

wxml文件中添加:

<view class=‘mapmask’ catchtouchstart=‘test’>

    <image src="…" />

</view>

回到顶部