如何将UINaivgationBar添加到作为选项卡控制器一部分的视图中
本文关键字:控制器 一部分 视图 选项 UINaivgationBar 添加 | 更新日期: 2023-09-27 18:12:50
我还在适应iPhone开发的整个"Controller"流程。
我使用MonoTouch来构建我的应用程序。
我的rootController是一个在AppDelegate中设置的TabBarController。
tabBarController = new UITabBarController ();
tabBarController.ViewControllers = new UIViewController [] {
mapView,
items,
account
};
在我的一个视图中,我想要有一个UINavigationControl,这样人们就可以点击项目,然后有返回的选项。
这是MapView的构造函数
public MapViewController () : base ("MapViewController", null)
{
Title = "Map";
TabBarItem.Image = UIImage.FromBundle ("Images/first");
}
我如何添加其他类型的视图控制器呢?
不要在标签栏中使用MapViewController
,只需添加UINavigationController
即可。然后你推MapViewController
。如果你的MapViewController
在UINavigationController
的堆栈上推了另一个控制器,UINavigationController
将通过在其顶部工具栏中提供一个按钮(UINavigationItem
)来为你处理"返回"工作。
您可能需要阅读UINavigationController
的文档和周围的所有示例。