Custom Navigation Controller in an MVVMCross App

痴心易碎 提交于 2019-12-11 09:15:58

问题


I'm working on an MVVMCross based app and need to use a custom UINavigationController but I'm struggling to see how I can do this as I can't see the point at which the navigation controller is created.

Can anyone give any guidance on how a custom UINavigationController can be used within MVVMCross


回答1:


You would do that in your own Presenter by overriding CreateNavigationController:

protected override UINavigationController CreateNavigationController(UIViewController viewController)
{
    var toReturn = base.CreateNavigationController(viewController);
    toReturn.NavigationBarHidden = false;
    toReturn.NavigationBar.TintColor = UIColor.FromRGB(15, 79, 140);
    toReturn.NavigationBar.BarTintColor = UIColor.FromRGB(228, 242, 231);
    toReturn.NavigationBar.Translucent = false;
    return toReturn;
}

Modify as needed. base.CreateNavigationController just creates an instance of UINavigationController.



来源:https://stackoverflow.com/questions/43681201/custom-navigation-controller-in-an-mvvmcross-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!