我需要更改SimpleDraweeView的背景颜色,我可以使用任何功能吗? SetBackgroundColor忽略圆形形状。
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/message_status_image"
android:layout_width="@dimen/medium_icon"
android:layout_height="@dimen/medium_icon"
fresco:backgroundImage="@color/grey"
fresco:placeholderImage="@drawable/ic_linked_white"
fresco:roundAsCircle="true" />
答案 0 :(得分:0)
目前不支持动态更改背景图像。您可以采取的解决方法是按照documentation中的说明以编程方式构建DraweeHierarchy
,并为背景设置自定义Drawable。保留对该drawable的引用,以便稍后可以访问它。
您可以简单地使用现有的RoundedColorDrawable
代替自定义绘图,当您需要更改颜色时,您只需要mBackgroundDrawable.setColor(color)
。