Skip to content

Commit 62cba00

Browse files
committed
Setting image src to null will clear the bitmap.
1 parent 502a37d commit 62cba00

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tns-core-modules/ui/image/image.android.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
ImageSource, ImageBase, stretchProperty, imageSourceProperty, srcProperty, tintColorProperty, unsetValue, Color,
2+
ImageSource, ImageBase, stretchProperty, imageSourceProperty, srcProperty, tintColorProperty, Color,
33
isDataURI, isFileOrResourcePath, RESOURCE_PREFIX
44
} from "./image-common";
55
import { path, knownFolders } from "../../file-system";
@@ -67,7 +67,9 @@ export class Image extends ImageBase {
6767

6868
public _createImageSourceFromSrc() {
6969
let imageView = this.nativeView;
70-
this.imageSource = <any>unsetValue;
70+
if (imageView) {
71+
imageView.setUri(null, 0, 0, false, true);
72+
}
7173

7274
if (!imageView || !this.src) {
7375
return;
@@ -76,7 +78,7 @@ export class Image extends ImageBase {
7678
let value = this.src;
7779
let async = this.loadMode === ASYNC;
7880

79-
if (typeof value === "string") {
81+
if (typeof value === "string" || value instanceof String) {
8082
value = value.trim();
8183
this.isLoading = true;
8284

0 commit comments

Comments
 (0)