From de5e54893e9765d08134fc02019c022d2f1703a0 Mon Sep 17 00:00:00 2001 From: "dongsug.song" Date: Tue, 27 Jun 2017 22:03:01 +0900 Subject: [PATCH] fix the difference of DefaultLayer and Layer - DefaultLayer has it's own size which is same as stage's - Added Layer has zero size and top-left parent origin so this causes different behavior when user adds Views under the newly created Layer - make same layouting behavior for both of DefaultLayer and Layer Change-Id: If2bb25dd42116591a390546ddcf191939c7bd3aa Signed-off-by: dongsug.song --- src/Tizen.NUI/src/public/Layer.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Tizen.NUI/src/public/Layer.cs b/src/Tizen.NUI/src/public/Layer.cs index b9ab260..91775d1 100755 --- a/src/Tizen.NUI/src/public/Layer.cs +++ b/src/Tizen.NUI/src/public/Layer.cs @@ -78,9 +78,26 @@ namespace Tizen.NUI public Layer() : this(NDalicPINVOKE.Layer_New(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - + if(Window.Instance != null) + { + this.SetAnchorPoint(Tizen.NUI.PivotPoint.TopLeft); + this.SetResizePolicy(ResizePolicyType.FillToParent, DimensionType.AllDimensions); + } + } + internal void SetAnchorPoint(Vector3 anchorPoint) + { + NDalicPINVOKE.Actor_SetAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal void SetResizePolicy(ResizePolicyType policy, DimensionType dimension) + { + NDalicPINVOKE.Actor_SetResizePolicy(swigCPtr, (int)policy, (int)dimension); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// /// Search through this layer's hierarchy for an view with the given unique ID. /// -- 2.7.4