问题
使用image标签,显示本地图片文件,在苹果机上正常,在安卓机器上有时能显示出来,有时不能,十分随性看心情👽,看不下去了,必须治治他!
<image class="mine" src="../img/mine.png"></image>
原因
根据可靠消息和缜密的推理得出最大嫌疑人是:weui,使用weui后会影响图片的正常显示,😔,自己家的东西都不兼容😓
解决办法
- 彻底放弃使用weui
- 将较小的图片转换为base64格式,较大的图片放在服务器使用网络下载
因为我无法彻底放弃使用weui,于是将图片进行了base64转码,之后问题就解决啦~
<image class="mine" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAgCAYAAAAFQMh/AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ME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JZEWgyXy+xrfc2At9l1ZiQnUrNsrIsF34bTP8XZah9oLxujQQ3mnEedLr8Q4SNGYpV15wC3D+FWIAuK/Ss6DKrNr5f5O9RBj2IharkYJDKojeRDiHkWt9x+DxI33VC4m6wzprXyRavlt0JWLzIHrXzmNxmKxIejvOiFFYTjG3ZE8C4RPzQkplRU3mPnaQpCqVJn2cc/sfxukiQKRypZLRTuj3UpPz5+fxYWWRtWDPHPpx/8D8Rq/PkjVOaLv3xkkwGG0VK2fAXe1i6T0jS3v7aU6dkWyWgjazXO20PINjPP0L8Y00AI6C0goRzUJpsPZ8VeAAQDONBcJ1577zAAAAABJRU5ErkJggg=="></image>
最后 🙌
好啦,以上就是我本次分享的全部内容啦,如果你觉得我的文章对你有一丢丢帮助,那么请不要吝啬你的赞👍哦,阿门~