y***@youjiuzs.com
y***@youjiuzs.com
  • 发布:2021-12-28 15:40
  • 更新:2021-12-29 18:14
  • 阅读:442

nvue使用h5+ API,效果错误

分类:nvue

cutNight(index){
// #ifdef APP-PLUS-NVUE
if(index){
this.viewBox = new plus.nativeObj.View('test',{top:this.iStatusBarHeight+'px',left:'0px',height:this.windowHeight+'px',width:this.windowWidth+'px'});
this.viewBox.interceptTouchEvent(false);
// 绘制图片
this.viewBox.drawBitmap( '/static/image/yyyy22.gif', {top:this.iStatusBarHeight+'px',left:'0px',width:this.windowWidth+'px',height:this.windowHeight+'px'},
{top:'auto',left:'auto',width:this.windowWidth+'px',height:this.windowHeight+'px'} );
this.viewBox.show();
console.log('View控件状态:'+ this.viewBox.isVisible());
}else{
// console.log(this.viewBox,"对象")
// let visible = this.viewBox.isVisible();
console.log('View控件状态:'+ this.viewBox.isVisible());
// // if(visible){
// this.viewBox.close();
// this.viewBox={};
// }
console.log('????')
let view = plus.nativeObj.View.getViewById('test');
if(view){
console.log("查找到id为'test'的View控件对象");
view.close();
}else{
console.log("未查找到id为'test'的View控件对象,请先创建");
}
}
// #endif
},

页面加载调用方法传true,页面隐藏调用方法传false,然后页面隐藏时根据id拿到的原生控件对象是null,这是啥原因呀,换id名字了还是一样,掉用隐藏和销毁原生控件对象方法都没有

2021-12-28 15:40 负责人:无 分享
已邀请:
DCloud_heavensoft

DCloud_heavensoft

Android还是iOS,hx版本多少?
另外,nvue本身就是原生渲染,用nvue自己的api渲染界面挺好,为啥还需要用给webview提供的nativeObj来渲染原生界面呢?

  • y***@youjiuzs.com (作者)

    我在nvue页面使用map组件,然后现在想要在地图上覆盖一层关于天气的效果图片,然后我把图片定位在map组件上面,然后在安卓可以对map进行拖动和缩放,在ios却无法拖动和缩放map,所以我就使用了h5+API,想不到其他的方法了。。。

    2021-12-30 11:10

  • DCloud_heavensoft

    回复 y***@youjiuzs.com: map有专门的api处理上面的覆盖,仔细看下map的文档

    2021-12-31 18:48

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