私はUITabBarに何らかの問題を抱えており、その件に関してオンラインで何かを見つけることができません。かなり私はビュー(TestView)と他のビューに含まれているTabBarを表示する:緑色のビューと赤いビュー。だから最初はTestViewのタブバーに2つのタブ、1つは緑のビュー、もう1つは赤いビューのタブバーが表示されます。これらのタブの1つがタッチされると、適切なビューが表示されます。しかしTestViewのタブはありませんUITabBarにないビューを表示しているときにUITabBarを持っていますか?
しかし、相続人MainAppDelegateコードと私は
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//Create the TabBar VC and ButtonSelect VC
testView = [[TestViewController alloc] init];
tabBarController = [[UITabBarController alloc] init];
//Create the viewcontroller's For the TabBarController
UIViewController *gvc = [[GreenViewController alloc] init];
UIViewController *rvc = [[RedViewController alloc] init];
//Make a array to containing the two viewcontrollers (for TabBar)
NSArray *viewControllers = [NSArray arrayWithObjects:gvc, rvc, nil];
//Attach the VC's to the TabBar
[tabBarController setViewControllers:viewControllers];
//Set to window
[window addSubview:[tabBarController view]];
[window addSubview:[testView view]];
[window makeKeyAndVisible];
[rvc release];
[gvc release];
return YES;
}
そしてThis何を得るの絵は、私が何を得る..です
してください彼lp
私はサイズ変更を修正しましたが、私はまだデフォルトでビューを表示するようにtestViewControllerを取得できません。また、緑色と赤色のビューはTabBarがタッチされたときにのみ表示されます – srome11
元の回答。 – MHC