English 中文(简体)
如何在 iPhone 上不使用 Interface Builder 将导航控制器放置在 tabBar 控制器上?
原标题:How to place a navigation controoler upon a tabBar controller in iPhone without using Interface Builder?

Can you provide me some good link or example, on how to place a navigation controller upon a tabBar controller in iPhone without using Interface builder. i know to create tabBar controller . Plese tel me how to place a navigation in the view provided by tabBar controller.

问题回答

如果我理解你的意思正确,你只需要创建一个带有一个或多个UINavigationController实例的NSArray,并将其分配给UITabBarController的viewControllers属性。

你需要进行调整,但这样的东西可能会起作用:

NSMutableArray* controllers = [NSMutableArray arrayWithCapacity:4];

for (NSUInteger i = 0; i < 4; ++i)
{
    UIViewController* innerController = [[[UIViewController alloc] init] autorelease];
    UINavigationController* outerController = [[[UINavigationController alloc] initWithRootViewController:innerController] autorelease];
    [controllers addObject:outerController];
}

[tabBarController setViewControllers:controllers animated:YES];




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签