I wrapped up android native UI components, and integrated it with my react native application. The layout is like this.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:layout_width="42dp"
android:layout_height="42dp"
android:background="@drawable/location_bubble">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/avatar_image"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_marginTop="6dp"
android:layout_centerHorizontal="true"
android:scaleType="centerCrop"
fresco:failureImageScaleType="fitCenter"
fresco:placeholderImage="@drawable/gift_box_0"
fresco:placeholderImageScaleType="centerCrop"
fresco:roundAsCircle="true" />
</RelativeLayout>
And I set imageUri of SimpleDraweeView dynamically in code:
SimpleDraweeView avatar = (SimpleDraweeView)infoWindow.findViewById(R.id.avatar_image); avatar.setImageURI(UserRepository.getInstance().getUserInfo().getAvatar().getUrl());
However, when I first open the react page, it only shows placeholder image. If I back to the previous page, and enter this react page again, then the drawee displays the correct image. So what should I do to solve this issue? Thanks!