uniapp , the WeChat applet image flashes when loaded

Reason: The applet picture is flickering because the picture has no height, and it changes from the highest height to the most suitable height when loading (after loading is complete, when the picture is displayed).

  • Method 1: Set the image height
  • Method 2: Globally set image adaptation (effect: when the image is loaded, the height will be ignored first, and the image will be displayed after loading)
    //全局设置图片自适应(我放在了uni.scss中)
    image{
        height:auto
    }
    

Guess you like

Origin blog.csdn.net/Shimeng_1989/article/details/127651522