2013-09-27 43 views
5

Khi tôi quay trở lại từ Bộ điều khiển Chế độ xem của tôi sang Bộ điều khiển Chế độ xem Chính (Tôi có hình động ngang), thanh điều hướng chính của tôi đặt một chút quá cao trong giây lát và sau đó nhảy trở lại đúng vị trí. Có ai biết tại sao không? Tôi đã googling nó nhưng không thành công.Tại sao Thanh Điều hướng của tôi tạm thời biến mất khi tôi loại bỏ chế độ xem phương thức trong iOS 7?

App đại biểu:

[navigationController.navigationBar setBarTintColor: [UIColor whiteColor]]; 
[navigationController.navigationBar setTranslucent: NO]; 

Khi tôi đẩy nút để mở Info Xem của tôi:

UIViewController *infoViewController; 
infoViewController = [[InfoViewController alloc] initWithNibName:@"InfoViewController" bundle: nil]; 
infoViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; 
[self presentViewController: infoViewController animated: YES completion:nil]; 

tôi không sử dụng Auto Layout trên bất kỳ xib-files. Tập tin xib của Main View Controller của tôi rỗng với Status Bar: Default. Thông tin của tôi Xem điều khiển xib-file có một số công cụ trong đó.

Mã đóng Modal View Controller của tôi:

-(IBAction)onBackBtnClick:(id)sender 
{ 
    [self dismissModalViewControllerAnimated: YES]; 
} 
+0

được bạn gọi [[UIApplication sharedApplication ] setStatusBarHidden: YES/NO] tại bất kỳ thời điểm nào? –

+0

Không! :/đó là lý do tại sao tôi bối rối – Jojo

+0

Chúng ta sẽ cần thêm ngữ cảnh. Đăng một số mã. Làm thế nào bạn loại bỏ bộ điều khiển xem? Bạn đang sử dụng AutoLayout? Nếu vậy, những hạn chế của bạn là gì? –

Trả lời

-1

Vấn đề có vẻ là

infoViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; 

Nếu bạn thay đổi này để

infoViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical; 

sau đó nó sẽ không còn nhảy. Điều này làm việc cho tôi. Chúc may mắn!

3

Tất cả những gì bạn phải làm là thêm đoạn mã sau trong viewWillAppear của lớp "InfoViewController" viewController

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

    [self.navigationController.navigationBar setTranslucent:NO]; 
    [self.navigationController.navigationBar.layer removeAllAnimations]; 
} 

Hy vọng nó sẽ làm việc với bạn :)

Các vấn đề liên quan