From 62cba0070f17c48a6fd3b747fc2c74338e4303b7 Mon Sep 17 00:00:00 2001 From: Panayot Cankov Date: Thu, 27 Apr 2017 12:02:50 +0300 Subject: [PATCH] Setting image src to null will clear the bitmap. --- tns-core-modules/ui/image/image.android.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tns-core-modules/ui/image/image.android.ts b/tns-core-modules/ui/image/image.android.ts index e959534e5..7dc00392f 100644 --- a/tns-core-modules/ui/image/image.android.ts +++ b/tns-core-modules/ui/image/image.android.ts @@ -1,5 +1,5 @@ import { - ImageSource, ImageBase, stretchProperty, imageSourceProperty, srcProperty, tintColorProperty, unsetValue, Color, + ImageSource, ImageBase, stretchProperty, imageSourceProperty, srcProperty, tintColorProperty, Color, isDataURI, isFileOrResourcePath, RESOURCE_PREFIX } from "./image-common"; import { path, knownFolders } from "../../file-system"; @@ -67,7 +67,9 @@ export class Image extends ImageBase { public _createImageSourceFromSrc() { let imageView = this.nativeView; - this.imageSource = unsetValue; + if (imageView) { + imageView.setUri(null, 0, 0, false, true); + } if (!imageView || !this.src) { return; @@ -76,7 +78,7 @@ export class Image extends ImageBase { let value = this.src; let async = this.loadMode === ASYNC; - if (typeof value === "string") { + if (typeof value === "string" || value instanceof String) { value = value.trim(); this.isLoading = true;