1

したがって、アプリを UIViewController (タブバーを表示せずに) で開始し、ナビゲーションバーとタブバーを使用して UITableView を入力します。問題は、アプリの起動時にタブバーが表示されることです。これについて誰でも助けていただければ幸いです...

4

2 に答える 2

0

-presentModalViewController:animated: を引数としてタブバーコントローラーを使用してメインの UIViewController に送信するか、次のようにする必要があると思います。

[myWindow addSubview: myTabBarController.view];
于 2010-04-04T08:18:11.780 に答える
0

アプリを (タブ バー ベースではなく) ナビゲーション ベースのアプリケーションにしてから、UITableView にタブ バーを追加します。

ここに UITabBar を追加するためのヘルプがあります

私はこのようにします:この場合、テーブルビューとマップビューを描画します(Locatiアプリケーションから)

tabBarController = [[UITabBarController alloc] init];          // creates your tab bar so you can add everything else to it

searchTableViewController = [[SearchTableViewController alloc] init];               // creates your table view - this should be a UIViewController with a table view in it, or UITableViewController
UINavigationController *searchTableNavController = [[[UINavigationController alloc] initWithRootViewController:searchTableViewController] autorelease];
[searchTableViewController release];                                                              // creates your table view's navigation controller, then adds the view controller you made. Note I then let go of the view controller as the navigation controller now holds onto it 

searchMapViewController = [[SearchMapViewController alloc] init];   
UINavigationController *mapTableNavController = [[[UINavigationController alloc] initWithRootViewController:searchMapViewController] autorelease];
[searchMapViewController release];                                                    // does exactly the same as the first round, but for your second tab at the bottom of the bar.

tabBarController.viewControllers = [NSArray arrayWithObjects:searchTableNavController, mapTableNavController,  nil]; //add both of your navigation controllers to the tab bar. You can put as many controllers on as you like

ずっと前にこのパターンを見つけました。原文を表示できなくてすみません。次に、関連するビューに tabbarcontoller を追加する必要があります ([...view addSubView:tabBarController];) おそらく最初にフレームを設定します。

于 2010-04-04T09:21:08.300 に答える