1***@qq.com
1***@qq.com
  • 发布:2019-05-20 16:29
  • 更新:2019-05-21 11:21
  • 阅读:2363

【报Bug】uni-app动态修改地图高度在ios上不生效

分类:HBuilderX

问题描述

:通过plus的方法创建地图或者使用uni-app的地图组件通过$getAppMap()来调用setStyles()修改地图的高度,在ios都不能起作用,在安卓均没有问题

开发环境:1.9.7.20190516-alpha

ios版本:iphone 5s 12.2

以下为测试代码

<template>
<view style="display: flex;flex-direction: column;height: 100%;">
<view @tap="add()" style="font-size: 50upx;">点击增加地图高度</view>
</view>
</template>

<script>
export default {
data() {
return {
height:200
}
},
methods: {
add(){
this.height=this.height+100;
this.map.setStyles({
height:this.height+'px'
})
console.log("地图高度:"+this.height);
}
},
onLoad() {

	},  
	onReady() {  
		  var map = plus.maps.create('map', {  
			width: '100%',  
			height: '200px',  
			 top:'100px'/*, 创建map时像素单位必须是px */  
		});  
		this.map=map;  
		const currentWebview = this.$mp.page.$getAppWebview();  
		currentWebview.append(map);  
	}  
}  

</script>

<style>

</style>

联系qq:1419121370

2019-05-20 16:29 负责人:无 分享
已邀请:
DCloud_iOS_XHY

DCloud_iOS_XHY

升级hx版本,并使用自定义组件模式

该问题目前已经被锁定, 无法添加新回复