mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 01:43:14 +08:00
fix(ios): race conditions with nativeView (#10182)
This commit is contained in:
@ -193,11 +193,13 @@ function setUIColorFromImage(view: View, nativeView: UIView, callback: (uiColor:
|
||||
bitmap = imageSource && imageSource.ios;
|
||||
} else if (imageUri.indexOf('http') !== -1) {
|
||||
style[symbolUrl] = imageUri;
|
||||
ImageSource.fromUrl(imageUri).then((r) => {
|
||||
if (style && style[symbolUrl] === imageUri) {
|
||||
uiColorFromImage(r.ios, view, callback, flip);
|
||||
}
|
||||
});
|
||||
ImageSource.fromUrl(imageUri)
|
||||
.then((r) => {
|
||||
if (style && style[symbolUrl] === imageUri) {
|
||||
uiColorFromImage(r.ios, view, callback, flip);
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
uiColorFromImage(bitmap, view, callback, flip);
|
||||
@ -360,7 +362,7 @@ function getDrawParams(this: void, image: UIImage, background: BackgroundDefinit
|
||||
function uiColorFromImage(img: UIImage, view: View, callback: (uiColor: UIColor) => void, flip?: boolean): void {
|
||||
const background = view.style.backgroundInternal;
|
||||
|
||||
if (!img) {
|
||||
if (!img || !view.nativeViewProtected) {
|
||||
callback(background.color && background.color.ios);
|
||||
|
||||
return;
|
||||
|
Reference in New Issue
Block a user