我在DialogViewController视图中实例化一个MvvmCross视图,如下所示
var myDialog = new MyDialogViewController();
var navController = new UINavigationController();
controller.NavigationBar.TintColor = UIColor.Black;
controller.PushViewController(myDialog, false);
Add(controller.View);这就是MyDialogViewController的样子:
public class MyDialogViewController : DialogViewController
{
public MyDialogViewController()
: base(UITableViewStyle.Grouped, new RootElement("MyRoot"), true)
{
var root = new RootElement("MyRoot") {
new Section
{
new HtmlElement("MyWebsite", https://www.mywebsite.com")
}
};
Root.Add(root);
}
}该对话框在NavigationBar中显示得很好,但是如果我选择了MyWebsite元素,就会显示Webview,但是没有NavigationBar,并且我无法向后导航。
对于需要导航到新窗口的元素,也会发生同样的情况,导航条将不显示。
知道如何在导航到NavigationBar后制作WebView显示吗?
发布于 2016-02-13 09:59:28
这对我起了作用:
var settings = new SettingsDialogViewController((SettingsViewModel)ViewModel, new RootElement("Settings"));
var window = UIApplication.SharedApplication.KeyWindow;
navigationController = window.RootViewController.ChildViewControllers[1].NavigationController;
navigationController.PushViewController(settings, true);
navigationController.NavigationBarHidden = false;https://stackoverflow.com/questions/35322342
复制相似问题