We used LayoutItem and LayoutGroup as default layout but many developer wants to use AbsoluteLayout as default.
So changed default layout to AbsoluteLayout.
for (uint i = 0; i < rootNode.ChildCount; i++)
{
View view = rootNode.GetChildAt(i);
- if (rootNode.Layout == null )
+ if (view.Layout == null )
{
- if (rootNode.GetType() == typeof(View))
- {
- rootNode.Layout = new LayoutGroup();
- AutomaticallyAssignLayouts(rootNode);
- }
- else
- {
- rootNode.Layout = new LayoutItem();
- }
+ view.Layout = new AbsoluteLayout();
+ AutomaticallyAssignLayouts(rootNode);
}
}
}
if (value?.Owner != null)
{
// Previous owner of the layout gets a default layout as a replacement.
- value.Owner.Layout = new LayoutGroup();
+ value.Owner.Layout = new AbsoluteLayout();
// Copy Margin and Padding to replacement LayoutGroup.
value.Owner.Layout.Margin = value.Margin;
{
// If child of this layout is a pure View then assign it a LayoutGroup
// If the child is derived from a View then it may be a legacy or existing container hence will do layouting itself.
- if (child.GetType() == typeof(View))
- {
- child.Layout = new LayoutGroup();
- }
- else
- {
- // Adding child as a leaf, layouting will not propagate past this child.
- // Legacy containers will be a LayoutItems too and layout their children how they wish.
- child.Layout = new LayoutItem();
- }
+ child.Layout = new AbsoluteLayout();
}
}
else