我是Objective-C的新手,正在开发一个简单的信息应用程序。每个屏幕只是简单地链接到另一个屏幕,目前没有任何真正的编程。当我为每个屏幕添加新的视图控制器时,我意识到这个应用程序将有大量的视图控制器。
我的问题是:这是处理这样一个简单应用程序的最好方法吗?有5个主要部分,每个部分包含3-5个子部分,这将导致许多视图控制器。我在想,有一种更简单、更干净的方法来在一个视图控制器中动态地操纵文本。有什么想法吗?
发布于 2013-05-04 00:12:30
您可以使用具有5个选项卡的tabBar控制器。在每个选项卡中都有一个导航控制器,用于管理此部分的其他视图控制器:
myTabBarController = [[UITabBarController alloc] init];
UIViewController *vc1 = [[UIViewController alloc] initWithNibName:name];
UINavigationController *nav1 = [[UINavigationController alloc] initWithRootViewController:vc1];
......
UIViewController *vc5 = [[UIViewController alloc] initWithNibName:name];
UINavigationController *nav5 = [[UINavigationController alloc] initWithRootViewController:vc5];
myTabBarController.viewControllers = [NSArray arrayWithObjects:nav1,...,nav5, nil];
[self.window addSubview:myTabBarController.view];就像这样..。附注:很抱歉格式不好,希望你能选一个主意。
https://stackoverflow.com/questions/16362319
复制相似问题