2010-07-22 86 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是一個桌面控制器,肯定是你的問題。