Using the combination of these NativeScript plugins, I successfully implemented a profile image picker: Image Picker Plugin Image Cropper Plugin
The process works seamlessly. I save the image in the same directory with the same name to replace the existing image.
To set the image path, I use the following code:
<Image [src]="imageSrc" class="profile-picture" (tap)="pickProfilePicture()"></Image>
However, I am encountering an issue where the new profile picture is only displayed after reopening the application.
I have attempted different solutions like using this.cd.detectChanges();
and resetting imageSrc
with
this.imageSrc="/profile_pic/profile_pic.png"
. When changing the name of the image during reset, it refreshes the view.
It seems like there could be some caching going on, or Angular may not detect a change as the imageSrc
string remains the same. Nevertheless, I need the profile picture to maintain that exact name.
Does anyone have suggestions on how to force a re-rendering of the Image?
Best regards, Force0234