ImageDisplayOptions
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
可能影响图片呈现效果的图片显示选项。此选项适用于图片的宽高比与图片容器的宽高比不一致的情况。
枚举 |
DEFAULT |
用灰色条形填补图片与图片容器之间的间隙。 |
WHITE |
用白色横线填补图片与图片容器之间的间隙。 |
CROPPED |
图片会进行缩放,以使图片宽度和高度达到或超过容器尺寸。如果缩放后的图片高度大于容器高度,可能会剪裁图片的顶部和底部;如果缩放后的图片宽度大于容器宽度,则剪裁图片的左侧和右侧。这与在播放 4:3 视频时在宽屏电视上播放“缩放模式”类似。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eImage display options control how an image is presented when its aspect ratio doesn't match the container's aspect ratio.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDEFAULT\u003c/code\u003e and \u003ccode\u003eWHITE\u003c/code\u003e options fill the surrounding gaps with gray or white bars, respectively, to maintain the image's original aspect ratio.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCROPPED\u003c/code\u003e scales the image to fit or exceed the container dimensions, potentially cropping parts of the image to eliminate gaps.\u003c/p\u003e\n"]]],[],null,["# ImageDisplayOptions\n\nPossible image display options for affecting the presentation of the image. This should be used for when the image's aspect ratio does not match the image container's aspect ratio.\n\n| Enums ||\n|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `DEFAULT` | Fill the gaps between the image and the image container with gray bars. |\n| `WHITE` | Fill the gaps between the image and the image container with white bars. |\n| `CROPPED` | Image is scaled such that the image width and height match or exceed the container dimensions. This may crop the top and bottom of the image if the scaled image height is greater than the container height, or crop the left and right of the image if the scaled image width is greater than the container width. This is similar to \"Zoom Mode\" on a widescreen TV when playing a 4:3 video. |"]]