簡體   English   中英

復雜的多視圖iphone ios

[英]Complex multiview iphone ios

我需要實現一個非常復雜的多視圖應用程序,我需要一些建議。 多視圖應用程序類似於:

第一個視圖:普通UIViewController有一個按鈕,當我按下它去第二個視圖第二個視圖(又名主視圖):一個帶有標簽欄的Windows,其中有兩個標簽欄項目之間切換:第二個視圖A:普通UIViewController帶有一些元素第二個視圖B:的UITableViewController

有人可以給我一個建議,從哪里開始閱讀或一些例子?

謝謝

我的建議是閱讀示例代碼表格apple ,你也可以找到編碼如何運氣好,或者你可以找到遍布堆棧的示例代碼只搜索。 例如基於導航的應用程序: UINavigationController不能在UITabBarController的moreNavigationController中工作

或簡單過渡:

SecondViewController *screen = [[SecondViewController alloc] initWithNibName:nil bundle:nil];
        screen.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;


        [self presentModalViewController:screen animated:YES];

        [screen release];

希望它有助於再見

wblade

您需要從基於視圖的應用程序開始。 然后在appDelegate文件中創建一個UITabbarController。

Appdelegate.h

UITabBarController * tabBarController;
//設置屬性

Appdelegate.m

// Synthsize

tabBarController = [[UITabBarController alloc] init];  
    tabBarController.delegate=self;  

//Adding Search,Nearby,Map,AboutUs,Favorites Tabs to tabBarController  
Search * search = [[Search alloc] init];  
UINavigationController *searchNav = [[UINavigationController alloc] initWithRootViewController:search];  

Nearby* nearby = [[Nearby alloc] init];  
UINavigationController *nearbyNav = [[UINavigationController alloc] initWithRootViewController:nearby];  

Map* map = [[Map alloc] init];  
UINavigationController *mapNav = [[UINavigationController alloc] initWithRootViewController:map];  

AboutUs* aboutUs = [[AboutUs alloc] init];  
UINavigationController *aboutUsNav = [[UINavigationController alloc] initWithRootViewController:aboutUs];  

Favorites* favorites = [[Favorites alloc] init];  
UINavigationController *favoritesNav = [[UINavigationController alloc] initWithRootViewController:favorites];  

NSArray* controllers = [NSArray arrayWithObjects:searchNav,nearbyNav,mapNav,aboutUsNav,favoritesNav, nil];  
tabBarController.viewControllers = controllers;  

[window addSubview:tabBarController.view];    

因此,您可以管理要在哪個選項卡中放置導航控制器或僅放置視圖控制器。

然后在上面提到的每個視圖控制器中,您需要實現
- (id)init {}
您可以在其中設置標簽名稱和圖像。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM