android - 使用 Glide 从 gif 中删除不必要的白色背景?
问题描述
使用Glide加载时,我得到了不必要的带有方形框的白色背景
以下是我的代码和屏幕截图;
Glide.with(NearByRestaurantsListActivity.this).load(R.raw.badge_green_yellow).asGif().
diskCacheStrategy(DiskCacheStrategy.NONE).crossFade().into(holder.ivHourlyIcon);
解决方案
尝试使用图像按钮并应用以下代码。android:background="?attr/selectableItemBackgroundBorderless"
将帮助您获得白色背景。加载这个滑翔。
<ImageButton
android:id="@+id/ivHourlyIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:layout_toStartOf="@id/stillshot"
android:layout_marginRight="@dimen/dp_5"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/circle_gallery"
tools:ignore="ContentDescription" />
推荐阅读
- python - For循环没有继续
- neo4j - 根据节点的 id 将节点从 CSV 加载到 Neo4j 中?
- mysql - 为什么mysql在JOIN查询中忽略INDEX
- excel - 如何在 VBA 中更新每周数据?
- jenkins - 如何通过 Jenkins 在 Openshift 中部署部署
- postgresql - 使用 ftp 连接到远程 postgresql 服务器
- java - 在 Wildfly Elytron 安全中使用 2authorization 领域
- opengl-es - 渲染独立骨骼
- mysql - 当其他表中不存在时更新列[大数据集]
- twitter-bootstrap - bootstrap 5 中的 grid-cols-* 实用程序在哪里?