2***@qq.com
2***@qq.com
  • 发布:2023-10-16 18:42
  • 更新:2023-11-18 14:53
  • 阅读:246

image组件显示右侧有白边

分类:uni-app

一个盒子里面有一个image,image右侧会出现一个2像素的白边这是啥问题

0 关注 分享

要回复文章请先登录注册

2***@qq.com

2***@qq.com (作者)

回复 2***@qq.com :
APP的确实没,看H5有,问题不大,能解决`https://img-blog.csdnimg.cn/917d4fee8aac42f19306d2aa29dbbe61.png`
2023-11-18 14:53
2***@qq.com

2***@qq.com (作者)

2023-11-18 14:51
喜欢技术的前端

喜欢技术的前端

回复 2***@qq.com :
是用你的代码跑的改了下,如图显示 https://img-blog.csdnimg.cn/7f0719960e7d4d17967b658293f26ac5.jpeg
```
<view style="background-color: #f8f8f8;height: 100vh;">
<view style="display: flex;justify-content: space-between;padding: 0 30rpx;">
<view class="goodsItem">
<image src="https://ask.dcloud.net.cn/static/images/side/ask_right_unicloud_class.jpg" class="image"></image>
<view class="title">这是商品标题这是商品标题</view>
</view>
<view class="goodsItem">
<image src="https://ask.dcloud.net.cn/static/images/side/ask_right_unicloud_class.jpg" class="image"></image>
<view class="title">这是商品标题这是商品标题</view>
</view>
</view>
</view>
```
2023-11-18 10:56
2***@qq.com

2***@qq.com (作者)

回复 喜欢技术的前端 :
不太行,直接把图片宽度设置比盒子多1px了,下面放有示例代码可以试一试,感觉是阴影衬托出来的效果,去掉阴影是看不出来的,加上就显示
2023-11-18 10:36
喜欢技术的前端

喜欢技术的前端

换个图片地址看看 https://ask.dcloud.net.cn/static/images/side/ask_right_unicloud_class.jpg
2023-11-15 19:14
2***@qq.com

2***@qq.com (作者)

回复 爱豆豆 :
```
<template>
<view>
<view class="goodsItem">
<image src="" class="image"></image>
<view class="title">这是商品标题这是商品标题</view>
</view>
</view>
</template>
<style lang="scss">
.goodsItem {
width: 326rpx;
background: #FFFFFF;
box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(0, 0, 0, 0.16);
border-radius: 16rpx;
padding-bottom: 28rpx;
margin-bottom: 28rpx;
box-sizing: border-box;
overflow: hidden;
.image {
display: block;
width: 326rpx;
height: 284rpx;
margin-bottom: 14rpx;
}
.title{
padding: 0 24rpx;
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #1D2129;
line-height: 38rpx;
text-align: justify;
}
}
</style>
```
2023-11-15 18:39
爱豆豆

爱豆豆

你直接吧这个代码片段发出来 方便我们排查
2023-10-17 09:09
套马杆的套子

套马杆的套子

感觉像是图片后面的背景,刚试了,image的话是没问题的
2023-10-17 09:01
2***@qq.com

2***@qq.com

给image标签加个font-size:0:试试?
2023-10-16 19:10