本文整理汇总了C#中UIViewController.DidMoveToParentViewController方法的典型用法代码示例。如果您正苦于以下问题:C# UIViewController.DidMoveToParentViewController方法的具体用法?C# UIViewController.DidMoveToParentViewController怎么用?C# UIViewController.DidMoveToParentViewController使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIViewController
的用法示例。
在下文中一共展示了UIViewController.DidMoveToParentViewController方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransitionPanel
public virtual void TransitionPanel(UIViewController newChildView)
{
Transition(PanelView, newChildView, 1.0, UIViewAnimationOptions.CurveEaseOut, () =>
{
},
(finished) =>
{
PanelView.RemoveFromParentViewController();
newChildView.DidMoveToParentViewController(this);
PanelView = newChildView;
});
}
示例2: YYCommentContainerViewController
public YYCommentContainerViewController (UIViewController child) : base ()
{
contentController = child;
AddChildViewController (child);
child.DidMoveToParentViewController (this);
if (child.WantsFullScreenLayout) {
WantsFullScreenLayout = true;
UIApplication.SharedApplication.SetStatusBarStyle (UIStatusBarStyle.BlackTranslucent, false);
}
commentViewController = new YYCommentViewController ();
commentViewController.associatedObject = (PhotoViewController)child;
}
示例3: SetContentViewController
// - (void)setContentViewController:(UIViewController *)contentViewController
public void SetContentViewController (UIViewController controller)
{
if (contentViewController != controller)
{
if (contentViewController != null) {
contentViewController.WillMoveToParentViewController(null);
contentViewController.RemoveFromParentViewController();
contentViewController.Dispose();
}
contentViewController = controller;
AddChildViewController(contentViewController);
contentViewController.DidMoveToParentViewController(this);
}
}
示例4: SetMenuViewController
// - (void)setMenuViewController:(UIViewController *)menuViewController
public void SetMenuViewController (UIViewController controller)
{
if (menuViewController != controller) {
if (menuViewController != null) {
menuViewController.WillMoveToParentViewController (null);
menuViewController.RemoveFromParentViewController ();
menuViewController.Dispose ();
}
menuViewController = controller;
AddChildViewController (menuViewController);
menuViewController.DidMoveToParentViewController (this);
}
}
示例5: OnModelSet
protected override void OnModelSet(Xamarin.Forms.VisualElement model)
{
base.OnModelSet (model);
var page = model as MyThirdPage;
var hostViewController = ViewController;
var viewController = new UIViewController ();
var label = new UILabel (new RectangleF(0, 40, 320, 40));
label.Text = "3 " + page.Heading;
viewController.View.Add (label);
hostViewController.AddChildViewController (viewController);
hostViewController.View.Add (viewController.View);
viewController.DidMoveToParentViewController (hostViewController);
}
示例6: CycleFromViewControllerToViewController
private void CycleFromViewControllerToViewController(UIViewController oldController,
UIViewController newController)
{
if (!MidTransition)
{
MidTransition = true;
oldController.WillMoveToParentViewController(null);
this.AddChildViewController(newController);
// Whether this is a good UI choice aside, Scroll next UIViewController in from Right (alter as required for other transitions)
RectangleF newControllerStartFrame =
new RectangleF(ContainerView.Frame.Location.X + ContainerView.Frame.Size.Width,
ContainerView.Frame.Location.Y, ContainerView.Frame.Size.Width,
ContainerView.Frame.Size.Height);
RectangleF oldControllerEndFrame =
new RectangleF(ContainerView.Frame.Location.X - ContainerView.Frame.Size.Width,
ContainerView.Frame.Location.Y, ContainerView.Frame.Size.Width,
ContainerView.Frame.Size.Height);
newController.View.Frame = newControllerStartFrame;
// If you try to start another Container change whilst previous one is in the middle of an animation, you will get an error, such as -
// Unbalanced calls to begin/end appearance transitions for <NibViewController: 0xd503cc0>.
// Unbalanced calls to begin/end appearance transitions for <ProgrammaticViewController: 0x14d58c30 ..
// Tried disabling UISegementedControl click to stop this happening but was jarring, so went for MidTransition variable.
// ChooseVCUISegementedControl.Enabled = false;
Transition(oldController, newController, 0.25, /*UIViewAnimationOptions.TransitionFlipFromLeft*/ 0,
() =>
{
newController.View.Frame = oldController.View.Frame;
oldController.View.Frame = oldControllerEndFrame;
}, delegate(bool finished)
{
oldController.RemoveFromParentViewController();
newController.DidMoveToParentViewController(this);
//ChooseVCUISegementedControl.Enabled = true;
MidTransition = false;
});
}
}
示例7: OnElementChanged
protected override void OnElementChanged (VisualElementChangedEventArgs e)
{
base.OnElementChanged (e);
var page = e.NewElement as MyThirdPage;
var hostViewController = ViewController;
var viewController = new UIViewController ();
var label = new UILabel (new CGRect(0, 40, 320, 40));
label.Text = "3 " + page.Heading;
viewController.View.Add (label);
hostViewController.AddChildViewController (viewController);
hostViewController.View.Add (viewController.View);
viewController.DidMoveToParentViewController (hostViewController);
}
示例8: SetContentViewController
void SetContentViewController (UIViewController cvc)
{
if (_contentViewController == null) {
cvc.View.Frame = _contentView.Bounds;
_contentViewController = cvc;
AddChildViewController (_contentViewController);
_contentView.AddSubview (_contentViewController.View);
_contentViewController.DidMoveToParentViewController (this);
} else if (_contentViewController != cvc) {
cvc.View.Frame = _contentView.Bounds;
_contentViewController.WillMoveToParentViewController (null);
AddChildViewController (cvc);
View.UserInteractionEnabled = false;
Transition (_contentViewController, cvc, 0, UIViewAnimationOptions.TransitionNone, () => {}, (finished) => {
View.UserInteractionEnabled = true;
_contentViewController.RemoveFromParentViewController ();
cvc.DidMoveToParentViewController (this);
_contentViewController = cvc;
});
}
}
示例9: Present
public virtual void Present(UIViewController controller, bool animated)
{
this.IsNavigating = true;
this.AddChildViewController(controller);
this.presentedController = controller;
presentedController.View.Alpha = 0;
presentedController.View.Frame = new RectangleF(this.ContentView.Bounds.Width, 0, this.ContentView.Bounds.Width, this.ContentView.Bounds.Height);
if (this.ShadowEnabled)
{
// ? maybe this.ApplyShadow(presentedController.View);
}
this.View.InsertSubviewAbove(controller.View, this.ContentView);
if (animated)
{
UIView.Animate(0.3f, 0, UIViewAnimationOptions.CurveEaseInOut | UIViewAnimationOptions.BeginFromCurrentState, () =>
{
this.ContentView.Frame = new RectangleF(0 - this.contentWidth + this.currentScrolledOffset, 0, this.ContentView.Bounds.Width, this.ContentView.Bounds.Height);
this.TitleView.Alpha = 0f;
presentedController.View.Alpha = 1f;
presentedController.View.Frame = this.View.Bounds;
}, () =>
{
presentedController.DidMoveToParentViewController(this);
this.IsNavigating = false;
});
}
else
{
this.ContentView.Frame = new RectangleF(0 - this.contentWidth + this.currentScrolledOffset, 0, this.ContentView.Bounds.Width, this.ContentView.Bounds.Height);
this.TitleView.Alpha = 0f;
presentedController.View.Alpha = 1f;
presentedController.View.Frame = this.View.Bounds;
presentedController.DidMoveToParentViewController(this);
this.IsNavigating = false;
}
}
示例10: AddController
public void AddController(UIViewController controller, float width)
{
this.AddChildViewController(controller);
this.items.Add(new PanoramaItem(controller, width));
if (this.hasAppeared)
{
this.CalculateItemMetrics(this.contentTop);
this.LayoutContent(this.currentScrolledOffset);
}
controller.DidMoveToParentViewController(this);
}
示例11: SetRightMenuViewController
void SetRightMenuViewController(UIViewController rightMenuViewController)
{
if (_rightMenuViewController == null) {
_rightMenuViewController = rightMenuViewController;
return;
}
HideViewController(_rightMenuViewController);
_rightMenuViewController = rightMenuViewController;
AddChildViewController(_rightMenuViewController);
_rightMenuViewController.View.Frame = View.Bounds;
_rightMenuViewController.View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
_menuViewContainer.AddSubview(_rightMenuViewController.View);
_rightMenuViewController.DidMoveToParentViewController(this);
AddMenuViewControllerMotionEffects ();
View.BringSubviewToFront(_contentViewContainer);
}
示例12: SetContentViewController
void SetContentViewController(UIViewController contentViewController)
{
if (_contentViewController == null) {
_contentViewController = contentViewController;
return;
}
HideViewController(_contentViewController);
_contentViewController = contentViewController;
AddChildViewController(_contentViewController);
_contentViewController.View.Frame = View.Bounds;
_contentViewContainer.AddSubview (_contentViewController.View);
_contentViewController.DidMoveToParentViewController (this);
UpdateContentViewShadow ();
if (Visible) {
AddContentViewControllerMotionEffects ();
}
}
示例13: DisplayContentController
private void DisplayContentController(UIViewController content)
{
AddChildViewController(content);
content.View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
content.View.Frame = new CGRect(0, 0, View.Frame.Size.Width, View.Frame.Size.Height);
View.AddSubview(content.View);
content.DidMoveToParentViewController(this);
}
示例14: SetRightMenuViewController
public void SetRightMenuViewController(UIViewController controller)
{
if (rightMenuViewController != controller) {
if (rightMenuViewController != null) {
rightMenuViewController.WillMoveToParentViewController (null);
rightMenuViewController.RemoveFromParentViewController ();
rightMenuViewController.Dispose ();
}
rightMenuViewController = controller;
if (controller != null)
{
AddChildViewController (rightMenuViewController);
rightMenuViewController.DidMoveToParentViewController (this);
}
}
}
示例15: ApplySideController
private void ApplySideController(ref UIViewController controllerStore, UIViewController newController, UIViewController otherController,
Action clearOtherController)
{
Action<UIViewController> beforeBlock = (x) => {};
Action<UIViewController, bool> afterBlock = (x, y) => {};
if (this.viewAppeared)
{
beforeBlock = (controller) =>
{
controller.View.RemoveFromSuperview();
};
afterBlock = (controller, left) =>
{
controller.View.Hidden = left ? this.SlidingControllerView.Frame.Location.X <= 0 : this.SlidingControllerView.Frame.Location.X >= 0;
controller.View.Frame = this.ReferenceBounds;
controller.View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
if (this.slidingController != null)
{
this.referenceView.InsertSubviewBelow(controller.View, this.SlidingControllerView);
}
else
{
this.referenceView.AddSubview(controller.View);
}
};
}
// start the transition
if (controllerStore != null)
{
controllerStore.WillMoveToParentViewController(null);
if (newController == this.CenterController)
{
this.CenterController = null;
}
if (newController == otherController && clearOtherController != null) clearOtherController();
beforeBlock(controllerStore);
// controllerStore.setViewDeckController(null);
controllerStore.RemoveFromParentViewController();
controllerStore.DidMoveToParentViewController(null);
}
// make the switch
if (controllerStore != newController)
{
// todo: dispose II_RELEASE(*controllerStore);
controllerStore = newController;
}
if (controllerStore != null)
{
newController.WillMoveToParentViewController(null);
newController.RemoveFromParentViewController();
newController.DidMoveToParentViewController(null);
// and finish the transition
UIViewController parentController = (this.referenceView == this.View) ? this : this.GetGrandParent();
if (parentController != null)
{
parentController.AddChildViewController(controllerStore);
}
// controllerStore.setViewDeckController(this);
afterBlock(controllerStore, controllerStore == this.LeftController);
controllerStore.DidMoveToParentViewController(parentController);
}
}