收藏
回答

downloadfile下载到本地的图片,ios上做背景不显示,安卓上正常,问题在哪里?

wx.downloadFile({

        url: 'https://naobo.lezhihuwa.net/xiaochengxu/images/loginbg.jpg',

        success (res) {

          if (res.statusCode === 200) {

            //console.log("开机音效缓存文件临时地址")

            wx.setStorageSync('loginbg', res.tempFilePath)

            that.setData({

              loginbg:res.tempFilePath

            })

          }

        }

      })

前台调用:

<view class="login" style="background-image: url({{loginbg}});">

对应的css样式

.login{

  width: 100%;

  height: 100vh;

  overflow: hidden;

  background-repeat: no-repeat;

  background-position: left top;

  background-size:100% 100%;

}

回答关注问题邀请回答
收藏
登录 后发表内容