image图片显示之后上下有等值的空白区域出现?

小程序 文章 2021-12-29 19:20 313 0 全屏看文

AI助手支持GPT4.0

image图片显示之后上下有等值的空白区域出现?After the image is displayed, there are blank areas of equal value at the top and bottom of the image?

image图片显示之后上下有等值的空白区域出现?
<view class="container"><image class="img" src="/uploads/cj/article/2021/12/29/dc082ca40b64020315a122258c700ace.jpg" mode="center"/> </view>


怎么才能消除

  怎么才能消除

回答:

社区技术运营专员-CJiang:

是加了padding吗?

NAMELESS:

你好,可以通过看调试器 - wxml - style调整样式。

因为你使用的是默认的container样式,有上下的padding,如图。

padding改为0就可以了。


游戏结束べ:

样式的问题吧,写个代码片段

https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

-EOF-

AI助手支持GPT4.0