mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
fix(ios): shadow does not consider z-index (#10433)
This commit is contained in:

committed by
GitHub

parent
9fae9c4281
commit
5a4bb7c38c
@ -864,7 +864,13 @@ export class View extends ViewCommon implements ViewDefinition {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
[zIndexProperty.setNative](value: number) {
|
[zIndexProperty.setNative](value: number) {
|
||||||
this.nativeViewProtected.layer.zPosition = value;
|
const nativeView: NativeScriptUIView = <NativeScriptUIView>this.nativeViewProtected;
|
||||||
|
|
||||||
|
nativeView.layer.zPosition = value;
|
||||||
|
// Apply z-index to shadows as well
|
||||||
|
if (nativeView.outerShadowContainerLayer) {
|
||||||
|
nativeView.outerShadowContainerLayer.zPosition = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[backgroundInternalProperty.getDefault](): UIColor {
|
[backgroundInternalProperty.getDefault](): UIColor {
|
||||||
|
@ -143,7 +143,7 @@ export namespace ios {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!needsMask) {
|
if (!needsMask) {
|
||||||
clearLayerMask(nativeView, background);
|
clearLayerMask(nativeView);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear box shadow if it's no longer needed
|
// Clear box shadow if it's no longer needed
|
||||||
@ -345,7 +345,7 @@ function maskLayerIfNeeded(nativeView: NativeScriptUIView, background: Backgroun
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearLayerMask(nativeView: NativeScriptUIView, background: BackgroundDefinition) {
|
function clearLayerMask(nativeView: NativeScriptUIView) {
|
||||||
if (nativeView.outerShadowContainerLayer) {
|
if (nativeView.outerShadowContainerLayer) {
|
||||||
nativeView.outerShadowContainerLayer.mask = null;
|
nativeView.outerShadowContainerLayer.mask = null;
|
||||||
}
|
}
|
||||||
@ -1127,6 +1127,7 @@ function drawBoxShadow(view: View): void {
|
|||||||
outerShadowContainerLayer.bounds = bounds;
|
outerShadowContainerLayer.bounds = bounds;
|
||||||
outerShadowContainerLayer.anchorPoint = layer.anchorPoint;
|
outerShadowContainerLayer.anchorPoint = layer.anchorPoint;
|
||||||
outerShadowContainerLayer.position = nativeView.center;
|
outerShadowContainerLayer.position = nativeView.center;
|
||||||
|
outerShadowContainerLayer.zPosition = layer.zPosition;
|
||||||
|
|
||||||
// Inherit view visibility values
|
// Inherit view visibility values
|
||||||
outerShadowContainerLayer.opacity = layer.opacity;
|
outerShadowContainerLayer.opacity = layer.opacity;
|
||||||
|
Reference in New Issue
Block a user