2010-07-22 64 views
1

我正在创建一个UINavigationBar,它工作正常。但是,它与我不想要的UITableView滚动。如何将导航栏锚定在屏幕底部,以便它不滚动?iPhone:锚定UINavigationBar到屏幕底部

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]; 

回答

-2

是的,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]; 
+0

你应该接受他的答案,如果它是正确的 – 2010-07-22 17:48:37

+0

我会的,但它说我不能为2天。 – 2010-07-22 17:59:59

5

这听起来像你将它添加到tableview而不是包含tableview的视图。如果self是一个桌面控制器,肯定是你的问题。