简体   繁体   中英

How to implement single view in Xamarin iOS & MVVMCross?

I'm trying to implement Login screen in first page but mvvmcross version 4.1.2 had implement Navigation Bar white transparent like image below. So how can i remove it (not hidden) ?

Thank for your help so much!

登录画面

The answer is simple by not using navigation controller. You can do that by don't use the default presenter within MVVMCross.

You can learn more about it within this post: http://gregshackles.com/presenters-in-mvvmcross-a-primer/

ou cannot completely remove the navigation controller when using MVVMCross, instead you would hide it. Which gives you the exact same effect as what you are looking for (I assume). As mentioned by @mafis above.

You can use a Custom iOS Presenter and do the following:

protected override UINavigationController CreateNavigationController(UIViewController viewController)
{
  var navBar = base.CreateNavigationController(viewController);
  navBar.NavigationBarHidden = true;
  return navBar;
}

This will hide the navigationBar for every view and make sure you get fullscreen views.

Let me know if this helps.

I was found best solution for this by override ViewWillAppear to hide navigation bar.

public override void ViewWillAppear(bool animated)
{
    base.ViewWillAppear(animated);
    NavigationController.SetNavigationBarHidden(false, false);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM