mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-26 20:00:16 +08:00
Setting image src to null will clear the bitmap.
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
ImageSource, ImageBase, stretchProperty, imageSourceProperty, srcProperty, tintColorProperty, unsetValue, Color,
|
ImageSource, ImageBase, stretchProperty, imageSourceProperty, srcProperty, tintColorProperty, Color,
|
||||||
isDataURI, isFileOrResourcePath, RESOURCE_PREFIX
|
isDataURI, isFileOrResourcePath, RESOURCE_PREFIX
|
||||||
} from "./image-common";
|
} from "./image-common";
|
||||||
import { path, knownFolders } from "../../file-system";
|
import { path, knownFolders } from "../../file-system";
|
||||||
@ -67,7 +67,9 @@ export class Image extends ImageBase {
|
|||||||
|
|
||||||
public _createImageSourceFromSrc() {
|
public _createImageSourceFromSrc() {
|
||||||
let imageView = this.nativeView;
|
let imageView = this.nativeView;
|
||||||
this.imageSource = <any>unsetValue;
|
if (imageView) {
|
||||||
|
imageView.setUri(null, 0, 0, false, true);
|
||||||
|
}
|
||||||
|
|
||||||
if (!imageView || !this.src) {
|
if (!imageView || !this.src) {
|
||||||
return;
|
return;
|
||||||
@ -76,7 +78,7 @@ export class Image extends ImageBase {
|
|||||||
let value = this.src;
|
let value = this.src;
|
||||||
let async = this.loadMode === ASYNC;
|
let async = this.loadMode === ASYNC;
|
||||||
|
|
||||||
if (typeof value === "string") {
|
if (typeof value === "string" || value instanceof String) {
|
||||||
value = value.trim();
|
value = value.trim();
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user