zoukankan      html  css  js  c++  java
  • 微信小程序

    1.iphone全面屏安全区设置

    constant(safe-area-inset-bottom)
    env(safe-area-inset-bottom)

    可以根据具体业务做具体j计算页面上view高度或者padding等

    2.自定义顶部高度

    wxml:

      <view class="header nav-wrap" style='height: {{height*2 + 20}}px;{{headerStyle}}'>
        <image src="/static/images/index_header_bg.png" mode="widthFix" class="bg"></image>
        <view class='nav-title title' style='line-height: {{height*2 + 44}}px;'>
          <image class="logo" src="/static/images/index_logo.png"></image>
          你的标题
        </view>
    
      </view>

    页面js:

    data:{
    height: app.globalData.height,
    }

    app.js

        wx.getSystemInfo({
          success: (res) => {
            this.globalData.height = res.statusBarHeight
          }
        })
    
      globalData: {
        height:0
      }

    如在滚动页面过程中有需要处理的逻辑或者样式等,在onPageScroll里面去实现:

      onPageScroll: function (e) { // 获取滚动条当前位置
        let scrollTop = e.scrollTop
        if (scrollTop >= (this.data.height * 3 )) {//这里的 this.data.height * 3 是我根据我的业务逻辑来做的判断 ,你可以使用你应用需要的值
          let h = this.data.height*2+44
          处理你的逻辑...
        } else {
        处理你的逻辑...
        }
      },    
    技术最菜,头发最少
  • 相关阅读:
    JSP自定义标签
    Java集合之Arrays 剖析
    关于Java8中的Comparator那些事
    关于Comparable和Comparator那些事
    浅析Thread的join() 方法
    多线程的具体实现
    如何实现 List 集合的线程安全
    集合使用 Iterator 删除元素
    Tomcat目录详解
    一文读懂微服务架构
  • 原文地址:https://www.cnblogs.com/gushengyan/p/14913069.html
Copyright © 2011-2022 走看看