ビューにボトムバーを追加して、いくつかのビュー(それぞれがナブバーで表示)をブラウズしている間、そこに保持したいと思います。私はそれがアップルのガイドラインに従うことを願っています(私はすでにナブバーだけが推奨されていることを知っています)、少なくとも、そのアプリケーションは受け入れられます。 そうするために、アプリケーションウィンドウにUIViewを追加しました。このUIViewのは、バーの項目のそれぞれのナビゲーションコントローラ(rootviewControllerとして各1)が含まれていUITabBarControllerが含まれていますiPhone:いくつかのビューの同じボトムバー
UIWindow *window=[[UIApplication sharedApplication] keyWindow];
MyUIViewController *mv=[[MyUIViewController alloc]init];
UINavigationController *navd = [[UINavigationController alloc] initWithRootViewController:mv];
navd.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"MyItem" image:[UIImage imageNamed:@"myImage.png"] tag:0];
NSMutableArray *controllers = [[NSMutableArray alloc] init];
[controllers addObject:navd];
UITabBarController *tbarController=[[UITabBarController alloc] init];
tbarController.viewControllers = controllers;
tbarController.customizableViewControllers = controllers;
UIView *vistaBarraInferior=tbarController.view;
[window addSubview:vistaBarraInferior];
[window makeKeyAndVisible];
それは動作しますが、私の問題は、私は戻って終了行きたいときに表示されますUITabBarControllerのアイビー。私が書く場合:
[self.tabBarController.view removeFromSuperview];
[self.parentViewController.navigationController popViewControllerAnimated:YES];
タブバーは現在のビューから削除されますが、私は 'でそれを上書きしているので、私は、前のビュー(私は何も前に持っていたルートビュー)に達するcan't initWithRootViewController 'を実行します。
これを簡単にするか、またはこの方法を外す他の方法はありますか?
ありがとうございます。
私はそれが私が実際にやっていることだと思います。 –