2010-12-30 29 views
9

Trong App iPhone của tôi có ba quan điểm, firstView, secondViewthirdView.Ẩn trong Navigationbar trong iPhone sdk

bây giờ tôi muốn đặt Nút Quay lại trong thanh điều hướng ở thirdView chỉ cần đưa tôi đến sao secondView chỉ

cho im mà viết code này theo quan điểm đầu tiên

self.navigationItem.hidesBackButton:NO; 

và nó hiển thị nút quay lại ở cả hai chế độ xem giâyXemthirdView

Tôi nên làm gì để ẩn nút quay lại trong chế độ xem thứ hai giây?

Trả lời

25

Tôi nghĩ bạn phải đặt [self.navigationItem setHidesBackButton:YES] trong giây thứ hai của mình. Và đặt [self.navigationItem setHidesBackButton:NO] trong thirdView của bạn.

+0

nhờ trả lời. tôi đã cố gắng để làm điều đó và nó ẩn nút quay lại từ secondView nhưng các probleams là nó cũng ẩn backbutton từ thirdView nhưng tôi muốn meke backbutton có thể nhìn thấy trong thirdView – ios

+0

@Prerak: Đặt [self.navigationItem setHidesBackButton: NO] trong ThirdView của bạn – EmptyStack

3
-(void)viewWillAppear:(BOOL)animated{ 

    [super viewWillAppear:animated]; 

    self.navigationItem.backBarButtonItem=nil; 

} 
OR 
-(void)viewWillAppear:(BOOL)animated{ 

    [super viewWillAppear:animated]; 

    self.navigationItem.hidesBackButton=YES; 

} 
3

Để ẩn nút quay lại trong thanh điều hướng

- (void)viewWillAppear:(BOOL)animated { 
    [super viewWillAppear:YES]; 

    self.navigationController.navigationBar.topItem.hidesBackButton = YES; 
} 

Để hiển thị các nút quay lại trong thanh điều hướng

- (void)viewWillAppear:(BOOL)animated { 
    [super viewWillAppear:YES]; 

    self.navigationController.navigationBar.topItem.hidesBackButton = NO; 
} 
Các vấn đề liên quan