我一直在UITabBar上遇到一些麻煩,並且在主題方面找不到任何關於在線的內容。我非常想顯示一個視圖(比如TestView)和一個包含其他視圖的TabBar:綠色視圖和紅色視圖。所以最初我希望TestView的底部有一個tabBar,帶有2個選項卡,一個用於綠色視圖,另一個用於紅色視圖,一旦觸及其中一個選項卡,將顯示相應的視圖,但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 2011-02-16 04:41:24