2012-06-20 48 views

回答

3

你想要那樣的東西嗎?

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 

    self.navigationController.navigationBar.translucent = YES; 
          self.wantsFullScreenLayout = YES; 

    UITapGestureRecognizer *tap = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideShowNavigation)] autorelease]; 
    tap.numberOfTapsRequired = 1; 
    [self.view addGestureRecognizer:tap]; 
} 

- (void) hideShowNavigation 
{ 
    [self.navigationController setNavigationBarHidden:!self.navigationController.navigationBarHidden]; 
} 
+0

謝謝!添加了使導航控制器與視圖重疊的代碼,而不是「將視圖向下推」以替代它。 – ingenspor

+0

我在我的視圖中有一個表視圖,但上述建議的方法實際上阻止我選擇表格行......任何其他的選擇? –

+0

我猜tap.cancelsTouchesInView = NO;應該有幫助 –