Answer the question
In order to leave comments, you need to log in
IOS: How to display a table with a navigation bar in a Cocos2d project?
Hey!
I need to make a page with a menu based on a UITableViewController in a project based on a template for Cocos2d. I was able to place the table itself on the stage, but it is without a navigation bar, although there should be one. I've been struggling with this for more than a day, but I still haven't been able to figure out where I'm stupid. How do I place the table on the stage:
- (id) init
{
if ((self = [super initWithColor:ccc4(255, 255, 255, 255)])) {
GamesTableViewController *table = [[GamesTableViewController alloc] initWithStyle: UITableViewStylePlain];
[[[CCDirector sharedDirector] openGLView] addSubview: [table tableView]];
/*.....*/
}
return self;
}
Answer the question
In order to leave comments, you need to log in
The navigation bar is managed by UINavigationController
[[[CCDirector sharedDirector] openGLView] addsubview: [[[UINavigationController alloc] initWithRootViewController: table] autorelease]]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question