iPhone:将UINavigationBar定位到屏幕底部

iPhone:将UINavigationBar定位到屏幕底部,iphone,uitableview,view,uinavigationbar,Iphone,Uitableview,View,Uinavigationbar,我正在创建一个运行良好的UINavigationBar。但是,它与我的UITableView一起滚动,这是我不想要的。如何将导航栏锚定在屏幕底部,使其不会滚动 bottomNav = [[UINavigationBar alloc] initWithFrame:CGRectMake(0.0, self.view.frame.size.height, self.view.frame.size.width, 44.0)]; bottomNav.barStyle = UIBarStyl

我正在创建一个运行良好的UINavigationBar。但是,它与我的UITableView一起滚动,这是我不想要的。如何将导航栏锚定在屏幕底部,使其不会滚动

    bottomNav = [[UINavigationBar alloc] initWithFrame:CGRectMake(0.0, self.view.frame.size.height, self.view.frame.size.width, 44.0)];
    bottomNav.barStyle = UIBarStyleBlackOpaque;
    [self.view addSubview:bottomNav];

听起来像是将其添加到tableview中,而不是添加到包含tableview的视图中。如果
self
是tableview控制器,那肯定是您的问题。

是的,TechZen您是对的。我需要将其添加到父视图控制器:

bottomNav = [[UINavigationBar alloc] initWithFrame:CGRectMake(0.0, self.view.frame.size.height - 20, self.view.frame.size.width, 44.0)];
bottomNav.barStyle = UIBarStyleBlackOpaque;
[self.parentViewController.view addSubview:bottomNav];

我会的,但上面说我两天内不行。