202206-22|微信小程序-image加载图片工具中显示,真机中不显示

举报
写程序的小王叔叔 发表于 2022/06/21 12:18:26 2022/06/21
【摘要】 主页:小王叔叔的博客支持:点赞👍关注✔️收藏💖在微信小程序中,加载图片时,image真机中不显示图片解决:将图片用英文命名,不用正文命名,即可解决。代码:.wxml <!-- 页面下端功能列表 --><view class="container"> <view class="contain_panel1"> <view class="contain_img1"> <im...

主页小王叔叔的博客

支持:点赞👍关注✔️收藏💖


在微信小程序中,加载图片时,image真机中不显示图片

解决:将图片用英文命名,不用正文命名,即可解决

代码:

.wxml 

<!-- 页面下端功能列表 -->
<view class="container">
  <view class="contain_panel1">
    <view class="contain_img1">
      <image src="../images/functionlists/kaoqin.png" />
    </view>
  </view>
  <view class="contain_panel2">
    <view class="contain_img2">
      <image src="../images/functionlists/kaoqin_tongji.png" />
    </view>
  </view>
  <view class="contain_panel3">
    <view class="contain_img3">
      <image src="../images/functionlists/kaoqin_qingjia.png" />
    </view>
  </view>
</view>
<view class="container2">
  <view class="contain_font1">
    <text>考勤打卡</text>
  </view>
  <view class="contain_font2">
    <text>考勤统计</text>
  </view>
  <view class="contain_font3">
    <text>考勤请假</text>
  </view>
</view>

<view class="container3">
  <view class="contain_panel4">
    <view class="contain_img4">
      <image src="../images/functionlists/map.png" class="contain-image" />
    </view>
  </view>
  <view class="contain_panel5">
    <view class="contain_img5">
      <image src="../images/functionlists/sports.png" />
    </view>
  </view>
  <view class="contain_panel6">
    <view class="contain_img6">
      <image src="../images/functionlists/scan.png" />
    </view>
  </view>
</view>
<view class="container4">
  <view class="contain_font4">
    <text>地图</text>
  </view>
  <view class="contain_font5">
    <text>运动</text>
  </view>
  <view class="contain_font6">
    <text>扫一扫</text>
  </view>
</view>
kaoqin.png" /> </view> </view> <view class="contain_panel2"> <view class="contain_img2"> <image src="../images/functionlists/kaoqin_tongji.png" /> </view> </view> <view class="contain_panel3"> <view class="contain_img3"> <image src="../images/functionlists/kaoqin_qingjia.png" /> </view> </view> </view> <view class="container2"> <view class="contain_font1"> <text>考勤打卡</text> </view> <view class="contain_font2"> <text>考勤统计</text> </view> <view class="contain_font3"> <text>考勤请假</text> </view> </view> <view class="container3"> <view class="contain_panel4"> <view class="contain_img4"> <image src="../images/functionlists/map.png" class="contain-image" /> </view> </view> <view class="contain_panel5"> <view class="contain_img5"> <image src="../images/functionlists/sports.png" /> </view> </view> <view class="contain_panel6"> <view class="contain_img6"> <image src="../images/functionlists/scan.png" /> </view> </view> </view> <view class="container4"> <view class="contain_font4"> <text>地图</text> </view> <view class="contain_font5"> <text>运动</text> </view> <view class="contain_font6"> <text>扫一扫</text> </view> </view>

.wxss

/* 底端功能列表*/

.container {
  display: flex;
  padding: 20rpx;
  flex-flow: row wrap;
  justify-content: flex-start;
  align-items: center;
  margin-left: 42rpx;
}

.container2 {
  display: flex;
  padding: 20rpx;
  flex-flow: row wrap;
  justify-content: flex-start;
  align-items: center;
  margin-left: 42rpx;
  margin-top: -40rpx;
}

.container3 {
  display: flex;
  padding: 20rpx;
  flex-flow: row wrap;
  justify-content: flex-start;
  align-items: center;
  margin-left: 42rpx;
  margin-top: 130rpx;
}

.container4 {
  display: flex;
  padding: 20rpx;
  flex-flow: row wrap;
  justify-content: flex-start;
  align-items: center;
  margin-left: 42rpx;
  margin-top: -40rpx;
}

.container contain_panel1 {
  width: 100rpx;
  height: 100rpx;
  display: flex;
  flex-direction: row;
}

.container contain_panel2 {
  width: 100rpx;
  height: 100rpx;
  display: flex;
  flex-direction: row;
}

.container contain_panel3 {
  width: 100rpx;
  height: 100rpx;
  display: flex;
  flex-direction: row;
}

.container contain_panel4 {
  width: 100rpx;
  height: 100rpx;
  display: flex;
  flex-direction: row;
}

.container contain_panel5 {
  width: 100rpx;
  height: 100rpx;
  display: flex;
  flex-direction: row;
}

.container contain_panel6 {
  width: 100rpx;
  height: 100rpx;
  display: flex;
  flex-direction: row;
}

.contain_img1 image {
  opacity: 1;
  background-color: transparent;
  border-color: rgb(34, 34, 34);
  border-style: none;
  height: 50px;
  width: 50px;
  margin-top: 0;
  position: absolute;
  left: 90rpx;
}

.contain_font1 text {
  border-style: none;
  border-width: 2px;
  color: rgb(102, 102, 102);
  font-size: 14px;
  height: 22px;
  line-height: 22px;
  margin-top: 100rpx;
  margin-left: 23rpx;
  position: absolute;
}

.contain_img2 image {
  opacity: 1;
  background-color: transparent;
  border-color: rgb(34, 34, 34);
  border-style: none;
  height: 50px;
  width: 50px;
  margin-top: 0;
  position: absolute;
  left: 300rpx;
}

.contain_font2 text {
  border-style: none;
  border-width: 2px;
  color: rgb(102, 102, 102);
  font-size: 14px;
  height: 22px;
  line-height: 22px;
  margin-top: 100rpx;
  margin-left: 230rpx;
  position: absolute;
}

.contain_img3 image {
  opacity: 1;
  background-color: transparent;
  border-color: rgb(34, 34, 34);
  border-style: none;
  height: 50px;
  width: 50px;
  margin-top: 0;
  position: absolute;
  left: 530rpx;
}

.contain_font3 text {
  border-style: none;
  border-width: 2px;
  color: rgb(102, 102, 102);
  font-size: 14px;
  height: 22px;
  line-height: 22px;
  margin-top: 100rpx;
  margin-left: 455rpx;
  position: absolute;
}

.contain_img4 image {
  opacity: 1;
  background-color: transparent;
  border-color: rgb(34, 34, 34);
  border-style: none;
  height: 50px;
  width: 50px;
  margin-top: 0;
  position: absolute;
  left: 90rpx;
}

.contain_font4 text {
  border-style: none;
  border-width: 2px;
  color: rgb(102, 102, 102);
  font-size: 14px;
  height: 22px;
  line-height: 22px;
  margin-top: 100rpx;
  margin-left: 45rpx;
  position: absolute;
}

.contain_img5 image {
  opacity: 1;
  background-color: transparent;
  border-color: rgb(34, 34, 34);
  border-style: none;
  height: 50px;
  width: 50px;
  margin-top: 0;
  position: absolute;
  left: 300rpx;
}

.contain_font5 text {
  border-style: none;
  border-width: 2px;
  color: rgb(102, 102, 102);
  font-size: 14px;
  height: 22px;
  line-height: 22px;
  margin-top: 100rpx;
  margin-left: 255rpx;
  position: absolute;
}

.contain_img6 image {
  opacity: 1;
  background-color: transparent;
  border-color: rgb(34, 34, 34);
  border-style: none;
  height: 50px;
  width: 50px;
  margin-top: 0;
  position: absolute;
  left: 530rpx;
}

.contain_font6 text {
  border-style: none;
  border-width: 2px;
  color: rgb(102, 102, 102);
  font-size: 14px;
  height: 22px;
  line-height: 22px;
  margin-top: 100rpx;
  margin-left: 475rpx;
  position: absolute;
}

.contain-image {
  position: absolute;
  height: 50px;
  width: 50px;
}

效果:

工具显示

真机显示图片经过压缩,调节高/宽像素


转载声明:本文为博主原创文章,未经博主允许不得转载。

⚠️注意 ~

💯本期内容就结束了,如果内容有误,麻烦大家评论区指出

如有疑问❓可以在评论区💬或私信💬,尽我最大能力🏃‍♀️帮大家解决👨‍🏫!

如果我的文章有帮助,欢迎点赞+关注✔️鼓励博主🏃,您的鼓励是我分享的动力🏃🏃🏃~

【版权声明】本文为华为云社区用户原创内容,未经允许不得转载,如需转载请自行联系原作者进行授权。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。