UIToolbar'lı bir UIViewController (altta) var ve UINavigationBar ile UINavigationBar eklemek istiyorum. Ancak UINavigationController görüntülenmiyor.UIViewController içinde UINavigationController ekleyin
MyViewController.m:
- (void)viewDidLoad
{
[super viewDidLoad];
int toolBarHeight = 44;
UIToolbar *toolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, [self.view bounds].size.height-toolBarHeight, [self.view bounds].size.width, toolBarHeight)];
UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:nil action:nil];
toolBar.items = @[button];
[self.view addSubview:toolBar];
MyNavigationController *myNav = [[MyNavigationController alloc] init];
[self addChildViewController:myNav];
}
viewController işlevini navigasyonController içine eklemeniz gerekir. '[[MyNavigationController alloc] initWithRootViewController: viewController];' – HelmiB