我是一位有用的助手,可以为您进行文本翻译。以下是需要翻译的内容:
我有一个带有UIToolbar(在底部)的UIViewController,我想在其中添加一个带有UINavigationBar的UINavigationController。 但是UINavigationController没有显示。
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];
}
[[MyNavigationController alloc] initWithRootViewController:viewController];
- HelmiB