简体   繁体   English

C#Xamarin.IOS / MonoTouch-工具栏消失

[英]C# Xamarin.IOS / MonoTouch - Toolbar Disappears

I have a Xamarin.IOS/Monotouch project with 2 views - MainView and View2. 我有一个Xamarin.IOS / Monotouch项目,具有2个视图-MainView和View2。

  • My MainView window has a navigationController at the top, and a toolbar at the bottom. 我的MainView窗口在顶部具有navigationController,在底部具有工具栏。
  • When I call PushViewController(View2,true); 当我调用PushViewController(View2,true); - I get pushed from MainView to my second view (View2). -我从MainView被推到第二个视图(View2)。
  • View2 also has a navigationController at the top, but it DOES NOT have a toolbar at the bottom - intentionally. View2的顶部也有NavigationController,但底部没有工具栏-故意。
  • When I click the "Back" button on View2 to push back to my MainView, the toolbar at the bottom of MainView has disappeared. 当我单击View2上的“后退”按钮以推回我的MainView时,MainView底部的工具栏消失了。

Any ideas on how to get around this? 关于如何解决这个问题的任何想法?

Much appreciated. 非常感激。

Check out this Xamarin tutorial ( Multi-Screened Applications ). 查看此Xamarin教程( 多屏应用程序 )。 You can download the sample project, have a look at the code and try adding a UIToolBar to the HomeScreen. 您可以下载示例项目,查看代码,然后尝试将UIToolBar添加到HomeScreen。 I did it and it works like a charm. 我做到了,它就像一种魅力。

I'd also suggest the use of a storyboard: it really simplifies dealing with the navigation. 我还建议使用情节提要:它确实简化了导航的处理。 A tutorial can be found here . 可以在这里找到教程。

Hope this helps. 希望这可以帮助。

My solution in the end was to set "ToolBar.Hidden = false;" 最后,我的解决方案是设置“ ToolBar.Hidden = false;”。 upon arriving in the view that I was pushing to. 在到达我一直坚持的观点之后。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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