android 如何在 fresco 的圆角边框上添加自定义图标

How to add custom Icon on fresco's rounded border in android

我正在使用 Fresco 图像加载器库,我只想在 Fresco's 圆角边框上添加自定义 image 图标。我用谷歌搜索找到了这样的功能,但没有找到任何合适的解决方案。请帮助我,这怎么可能。我正在附加 screenshot 并且我需要根据我的要求提供的功能。

Fresco 支持覆盖,因此只需使用您的图标将覆盖添加到受票人层次结构即可。

http://frescolib.org/docs/drawee-branches.html#Overlays

例如,在 XML 中你可以这样做:

<com.facebook.drawee.view.SimpleDraweeView
  xmlns:fresco="http://schemas.android.com/apk/res-auto"
  android:id="@+id/my_image_view"
  android:layout_width="40dp"
  android:layout_height="40dp"
  fresco:overlayImage="@drawable/your_overlay"
  />

您必须相应地放置叠加图像,例如使用 <bitmap android:gravity="bottom|right" />、ninepatch 或自定义绘图。另见 https://developer.android.com/guide/topics/resources/drawable-resource.html and How to get gravity 'bottom' working on a drawable in xml