在地图上的按钮在模拟器上能显示,用微信去预览按钮就显示不了了
发布于 5 年前 作者 jun67 16477 次浏览 来自 问答

我在map上放了一个image,在模拟器上能显示,然后用微信去预览就显示不了了,这是什么鬼,下面是我写的代码,求大神解答


<view class="mainview">

<view class="top">

<text style="color:white">我的位置</text>

</view>

<view style="width:100%;height:100%">

<map  markers="{{markers}}"  latitude="{{latitude}}" longitude="{{longitude}}" style="width:100%;height:91%;position:absolute;" />

<image src="/file/getlocation.png" bindtap="clickGetLocation" style="position:absolute; z-index:2;top:88%;left:10px; width:48px;height:48px;"></image>

</view>

</view>


/* pages/jsms/home.wxss */

.mainview{

    height: 100%;

    position: absolute;

    width: 100%;

}

.top{

  width: 100%;

  height: 9%;

  line-height:48px;

  background: #FF9419;

  text-align: center;

}

1 回复

这么写不行的,textareamapcanvasvideo 这四个组件是由客户端创建的原生组件,它的层级是最高的。

你的image是盖不上去的,模拟器上面的效果是假的

要实现这种效果,用canvas或map的controls

参考

https://developers.weixin.qq.com/blogdetail?action=get_post_info&lang=zh_CN&token=169241781&docid=2af2c8d6a514e4cae76ccbfba7e84584

回到顶部