复杂的多视图 iPhone ios

发布于 2024-10-24 19:07:27 字数 260 浏览 4 评论 0原文

我需要实现一个对我来说非常复杂的多视图应用程序,我需要一些建议。多视图应用程序类似于:

第一个视图:带有一个按钮的普通 UIViewController,当我按下它时转到第二个视图 第二个视图(又名主视图):带有选项卡栏的窗口,其中有 2 个选项卡栏项目,可在以下选项之间切换: 第二个视图 A:带有一些元素的普通 UIViewController 第二个视图 B:UITableViewController

有人能给我建议从哪里开始阅读或一些示例吗?

谢谢

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

Can someone give me an advice where to start reading or some examples?

thx

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

孤芳又自赏 2024-10-31 19:07:27

我的建议是阅读示例代码表单 apple 在那里,您还可以找到如何编码,祝您好运,或者您可以通过搜索在整个堆栈中找到示例代码。例如基于导航的应用程序:
UINavigationController 在 UITabBarController 的 moreNavigationController 中不起作用

或简单的过渡:

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


        [self presentModalViewController:screen animated:YES];

        [screen release];

希望它对您有所帮助,

wblade

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. for example navigation based app:
UINavigationController doesn't work in a the moreNavigationController of a UITabBarController

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

指尖微凉心微凉 2024-10-31 19:07:27

您需要从基于视图的应用程序开始。然后在 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 {}
您可以在其中设置选项卡名称和图像。

You need to start with view based application. And then create a UITabbarController in you appDelegate file.

Appdelegate.h

UITabBarController *tabBarController;
// set properties

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

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 {}
in which you can set Tab name and image.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文