在一个页面中使用了map组件,正常展示效果如下图:
---------------------------------------------
可是在安卓手机中10次里面有8次会发生map跑上去挡住view层。ios中偶尔也会出现,但最后map会自动闪回到下方,而在安卓中map就一直在上方挡着。
下面是代码:
wxml: <view class= "header" > <image src= "/images/aboutus-headimg.jpg" mode= "widthFix" /> </view> <view class= "mapwrapper" > <map class= "map" id= "map" longitude= "{{page_data.lon}}" latitude= "{{page_data.lat}}" scale= "15" markers= "{{markers}}" show-location bindtap= "openmap" bindmarkertap= "openmap" bindcallouttap= "openmap" > </map> </view> wxss: .header { display: flex; flex-direction: column; } .header image { width: 100%; } .mapwrapper { display: flex; flex-direction: column; min -height: 100rpx; padding: 0 30rpx; margin: 0; } .map { width:100%; height: 400rpx; margin-top:30rpx; } |
打开vconsole看下是否已经同层?
用这个
https://developers.weixin.qq.com/miniprogram/dev/component/cover-view.html
原生组件层级高