【发布时间】:2020-01-19 07:16:10
【问题描述】:
以下代码适用于显示 PNG 图像,但不适用于 JPG 图像
GlideApp.with(playerBinding.ivLogoHomeTeam.context)
.load("https://JPN-CR1@2x.png")
.into(playerBinding.ivLogoHomeTeam)
XML:
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/iv_logo_home_team"
android:layout_width="@dimen/match_item_team_logo"
android:layout_height="@dimen/match_item_team_logo"
android:layout_marginStart="@dimen/unit_dp_10"
android:layout_marginLeft="@dimen/unit_dp_10"
android:layout_marginEnd="@dimen/unit_dp_10"
android:layout_marginRight="@dimen/unit_dp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@drawable/ic_launcher_background" />
编辑:JPEG 图像适用于 HTTPS 图像,而 HTTP 图像不起作用。我们如何显示 HTTP 图像?
【问题讨论】:
-
据我所知,它支持它,你能显示imageView XML代码吗?
-
@Lenoarod XML 添加。我尝试手动添加 jpg URL,仍然没有显示
-
你能分享那个 jpg 图片的 URL 吗?
-
@johnrao07,jpg图片的url是https还是http?
-
@Lenoarod PNG 图片是 HTTPS,JPG 是 HTTP
标签: android android-glide