• apicloud 注意事项


    页面布局时头部和内容一定要分开,状态栏寖入式要用。可以用api.sendEvent广播出去,api.addlisterten监听.

    api.openWin打开页面会有黑色闪屏,加bgColor:'#fff',  ios有页面滑动加 slidBackEnabled: false去掉.

    启动页  打开到登录页按返回键到启动页面会停止不动   应该监听返回键退出应用

    api.addEventListener({
      name: 'keyback'
    }, function(ret, err) {
      if (ret) {
      //console.log("1")
        api.closeWidget({
        silent : true
      });
      } else {
      console.log(JSON.stringify(err));
      }
    });

    safeArea 页面不被其它内容(如状态栏)遮住的区域,JSON对象通过safeArea能够知道当前页面哪些地方被遮住,从而做出相应的调整,保证页面重要元素不被遮挡住。比如应对顶部header被状态栏遮住一部分,可以为header增加一个paddingTop,如: header.style.paddingTop = api.safeArea.top + ‘px’;

    在比如在iPhone X上面,底部的导航菜单会被虚拟Home键遮住一部分,可以为footer增加一个paddingBottom,如:

    footer.style.paddingBottom = api.safeArea.bottom + ‘px’;

    //apicloud 学习网址 https://blog.csdn.net/qq_40299179/article/details/81233970
    https://docs.apicloud.com/Client-API/api#60 api.toast

    //底部虚拟按键遮罩层的显示和隐藏 遮住底部导航栏 start
    var footerPos = $api.offset($api.byId('footer'));
    rect: {
    x: 0,
    y: 0,
    w: 'auto',
    h: 'auto',
    marginLeft: 0,
    marginTop: 0,
    marginBottom: footerPos.h,
    marginRight: 0,
    },
    //底部虚拟按键遮罩层的显示和隐藏 遮住底部导航栏 end openFrame时rect用margin布局

    应该是在<body>中写一个resize事件计算高度,而高度计算不能用api.winHeight,应该是window.innerHeight

    <body onresize="resize();">

  • 相关阅读:
    运营设计方法论
    使用 typescript ,提升 vue 项目的开发体验(2)
    PAT 1078. 字符串压缩与解压
    PAT 1077. 互评成绩计算
    PAT 1076. Wifi密码
    PAT 1075. 链表元素分类
    PAT 1074. 宇宙无敌加法器
    PAT 1073. 多选题常见计分法
    PAT 1072. 开学寄语
    PAT 1071. 小赌怡情
  • 原文地址:https://www.cnblogs.com/whlBooK/p/10115243.html
Copyright © 2020-2023  润新知