zoukankan      html  css  js  c++  java
  • 微信小程序-ios系统-下拉上拉出现白色,如何处理呢?

    这几天做小程序,有些页面都是全屏的背景,在安卓上背景是固定的,而在ios上上拉下拉出现白色,测试说体验不太好,一开始我以为是下拉上拉刷新造成的,关闭了依然是这样。为了体验好点,可以按一下解决:

    方式一:

      可以在page.json文件内配置 :"backgroundColor": "#ccc" 属性,这个方法比较便捷。但是对于一些全屏背景的页面体验还不是很好

    方式二:

      对于一些全屏背景页面,我们可以让背景固定这样体验会好点,可以按以下进行操作:

      1》page.json设置 "disableScroll":true ; 表示:设置为 true 则页面整体不能上下滚动;只在 page.json 中有效,无法在 app.json 中设置该项

      2》对于一些页面内容太多,需要页面需要上下滑动的可以在page.wxml页面这么处理

    <scroll-view scroll-y style="height:{{wh}}px;" bindscrolltolower="onBottom">
    
    </scroll-view>

      3》page.js

    wx.getSystemInfo({
        success: function (res) {
        that.setData({
            "wh": res.windowHeight
        })
        }
    })

      4》全屏背景样式

      page{background: url(xxx.png) no-repeat center center fixed;background-size: cover; } 

  • 相关阅读:
    BZOJ1930 [Shoi2003]pacman 吃豆豆
    hdu5322 Hope
    hdu5390 tree
    hdu4609 3-idiots
    hdu5354 Bipartite Graph
    hdu4918 Query on the subtree
    hdu5314 Happy King
    [题解] PowerOJ 1741 最长递增子序列问题 (最大流)
    [题解] PowerOJ 1740 圆桌问题 (最大流)
    [题解] PowerOJ 1739 魔术球问题 (最大流)
  • 原文地址:https://www.cnblogs.com/changxue/p/8420893.html
Copyright © 2011-2022 走看看