简体   繁体   English

复杂的多视图iphone ios

[英]Complex multiview iphone ios

i need to implement a multiview app really complex to me and i need some advice. 我需要实现一个非常复杂的多视图应用程序,我需要一些建议。 The multiview app is something like: 多视图应用程序类似于:

First view: Normal UIViewController with one button, when i push it go to second view Second view(aka mainview): a Windows with Tab Bar with 2 tabbar item who switch between: Second view A: Normal UIViewController with some elements Second view B: UITableViewController 第一个视图:普通UIViewController有一个按钮,当我按下它去第二个视图第二个视图(又名主视图):一个带有标签栏的Windows,其中有两个标签栏项目之间切换:第二个视图A:普通UIViewController带有一些元素第二个视图B:的UITableViewController

Can someone give me an advice where to start reading or some examples? 有人可以给我一个建议,从哪里开始阅读或一些例子?

thx 谢谢

my advice is to read sample code form apple there you can also find coding how to s so good luck, or you can find example codes all over the stack just search. 我的建议是阅读示例代码表格apple ,你也可以找到编码如何运气好,或者你可以找到遍布堆栈的示例代码只搜索。 for example navigation based app: UINavigationController doesn't work in a the moreNavigationController of a UITabBarController 例如基于导航的应用程序: UINavigationController不能在UITabBarController的moreNavigationController中工作

or simple transition: 或简单过渡:

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


        [self presentModalViewController:screen animated:YES];

        [screen release];

hope it helps bye 希望它有助于再见

wblade wblade

You need to start with view based application. 您需要从基于视图的应用程序开始。 And then create a UITabbarController in you appDelegate file. 然后在appDelegate文件中创建一个UITabbarController。

Appdelegate.h Appdelegate.h

UITabBarController *tabBarController; UITabBarController * tabBarController;
// set properties //设置属性

Appdelegate.m Appdelegate.m

// Synthsize // 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];    

You can accordingly manage in which tab you want to place navigation controller or only a view controller. 因此,您可以管理要在哪个选项卡中放置导航控制器或仅放置视图控制器。

Then in each of the view controllers mentioned above you need to implement 然后在上面提到的每个视图控制器中,您需要实现
- (id)init {} - (id)init {}
in which you can set Tab name and image. 您可以在其中设置标签名称和图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM