private static void Adopt(NSViewController parent, NSViewController child) { // ensure the child view fills our entire frame child.View.Frame = parent.View.Bounds; #if UIKIT child.View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; #else child.View.AutoresizingMask = NSViewResizingMask.WidthSizable | NSViewResizingMask.HeightSizable; #endif child.View.TranslatesAutoresizingMaskIntoConstraints = true; parent.AddChildViewController(child); #if UIKIT var parentAlreadyVisible = parent.IsViewLoaded && parent.View.Window != null; if (parentAlreadyVisible) { child.BeginAppearanceTransition(true, false); } #endif parent.View.AddSubview(child.View); #if UIKIT if (parentAlreadyVisible) { child.EndAppearanceTransition(); } child.DidMoveToParentViewController(parent); #endif }
private static void Adopt(NSViewController parent, NSViewController child) { parent.AddChildViewController(child); parent.View.AddSubview(child.View); // ensure the child view fills our entire frame child.View.Frame = parent.View.Bounds; #if UIKIT child.View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; #else child.View.AutoresizingMask = NSViewResizingMask.WidthSizable | NSViewResizingMask.HeightSizable; #endif child.View.TranslatesAutoresizingMaskIntoConstraints = true; #if UIKIT child.DidMoveToParentViewController(parent); #endif }
private static void Adopt(NSViewController parent, NSViewController child) { parent.AddChildViewController(child); parent.View.AddSubview(child.View); // ensure the child view fills our entire frame child.View.Frame = parent.View.Bounds; #if UIKIT child.View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; #else child.View.AutoresizingMask = NSViewResizingMask.WidthSizable | NSViewResizingMask.HeightSizable; #endif child.View.TranslatesAutoresizingMaskIntoConstraints = true; #if UIKIT child.DidMoveToParentViewController(parent); #endif }