mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-04 12:58:38 +08:00
fix(shared-transition): iOS snapshot opacity (#10278)
This commit is contained in:
@ -368,10 +368,13 @@ export namespace iOSNativeHelper {
|
|||||||
return view.image;
|
return view.image;
|
||||||
}
|
}
|
||||||
// console.log('snapshotView view.frame:', printRect(view.frame));
|
// console.log('snapshotView view.frame:', printRect(view.frame));
|
||||||
|
const originalOpacity = view.layer.opacity;
|
||||||
|
view.layer.opacity = originalOpacity > 0 ? originalOpacity : 1;
|
||||||
UIGraphicsBeginImageContextWithOptions(CGSizeMake(view.frame.size.width, view.frame.size.height), false, scale);
|
UIGraphicsBeginImageContextWithOptions(CGSizeMake(view.frame.size.width, view.frame.size.height), false, scale);
|
||||||
view.layer.renderInContext(UIGraphicsGetCurrentContext());
|
view.layer.renderInContext(UIGraphicsGetCurrentContext());
|
||||||
const image = UIGraphicsGetImageFromCurrentImageContext();
|
const image = UIGraphicsGetImageFromCurrentImageContext();
|
||||||
UIGraphicsEndImageContext();
|
UIGraphicsEndImageContext();
|
||||||
|
view.layer.opacity = originalOpacity;
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user