【问题标题】:ImageView covers extra white spaceImageView 覆盖了额外的空白区域
【发布时间】:2019-08-23 13:29:52
【问题描述】:

您好,我正在 android 中创建布局,但问题是 ImageView 覆盖了额外的空白区域。我已经添加了scaleType,@ 987654324,但所有徒劳无功。请帮忙,我该怎么办?

<ImageButton android:id="@+id/ibInitialStock"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/initial_stock"
    android:background="@android:color/transparent"
    android:adjustViewBounds="true"
    android:scaleType="fitXY" />

但没有任何效果。

【问题讨论】:

  • 您的图像是否具有额外的填充? span>
  • 检查图像是否具有白色背景? span>

标签: android android-layout android-imageview


【解决方案1】:

我认为空白是你的形象,

尝试使用

  android:scaleType="centerCrop"

或者尝试替换你的图片

【讨论】:

    猜你喜欢
    • 2020-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-25
    • 1970-01-01
    • 1970-01-01
    • 2020-12-13
    • 2015-03-04
    相关资源
    最近更新 更多