调用高德地图,遮罩层按钮在真机调试时候不显示
发布于 6 年前 作者 dpeng 5025 次浏览 来自 问答

以下是代码,开发者工具没有问题,真机的时候就不显示按钮

 index.wxml

<view class=“map”>  <map class=“map” id=“map” longitude="{{longitude}}" latitude="{{latitude}}" scale=“14” show-location=“true” markers="{{markers}}" bindmarkertap=“makertap”></map>

</view>

<button bindtap=“addRequirement” class=“publish-btn”>发布需求</button>

index.wxss

.map{

  width: 100%;

  height: 100vh;

}

.publish-btn

{

color:white;

background-color: black;

position:fixed;

display: true;

_position:relative; /* hack for IE6 */

z-index:1;

top: 90%;

margin:auto;

left:30%;

right:30%;

border-radius: 0px;

border-bottom-left-radius:20px;

border-top-left-radius:20px;

border-bottom-right-radius:20px;

border-top-right-radius:20px;

font-size: 18px;

font-family: “微软雅黑”;

}

真机调试下按钮不显示

1 回复

你好,原生组件的层级是,无法通过层级去控制, 你可使用cover-view去搭配使用:这是有关文档:https://developers.weixin.qq.com/miniprogram/dev/component/cover-view.html

回到顶部