2013-10-02 2 views
0

나는 슬라이딩 메뉴를 만들고 있습니다. 그러나 슬라이드를 열고 닫을 때 전면보기 컨트롤러의 탐색 모음이 시스템 상태 표시 줄과 겹칩니다. 하위보기 컨트롤러가 엉망인 겹쳐진 상태 표시 줄을 수정하는 방법은 무엇입니까?

enter image description here

if (should_hide_status_bar) 
{ 
    [[UIApplication sharedApplication] setStatusBarHidden:is_going_to_open withAnimation:(UIStatusBarAnimationSlide)]; 
} 

[UIView animateWithDuration:DURATION delay:0 usingSpringWithDamping:2 initialSpringVelocity:1 options:(0) animations:^ 
{ 
    CGFloat    disp0 = state == AASlideViewControllerSlidingStateClose ? 0 : OPEN_X_POS; 
    CGAffineTransform t1  = CGAffineTransformMakeTranslation(disp0, 0); 

    self.frontViewController.view.transform = t1; 
} 
completion:^(BOOL finished) 
{ 
    self->_flags.is_sliding    = NO; 
    self.view.userInteractionEnabled = YES; 
}]; 

이 문제를 어떻게 해결 하는가?

답변

0

이것은 단순히 상태 표시 줄 가시성을 애니메이션 블록 밖으로 설정했기 때문입니다. 이것을 애니메이션 블록으로 옮기면 올바르게 동작하는 것을 볼 수 있습니다.

BOOL const  should_hide_status_bar = _shouldHideStatusBarWhenOpen; 
BOOL const  is_going_to_open  = state == AASlideViewControllerSlidingStateOpen; 

[UIView animateWithDuration:DURATION delay:0 usingSpringWithDamping:2 initialSpringVelocity:1 options:(0) animations:^ 
{ 
    CGFloat    disp0 = state == AASlideViewControllerSlidingStateClose ? 0 : OPEN_X_POS; 
    CGAffineTransform t1  = CGAffineTransformMakeTranslation(disp0, 0); 

    self.frontViewController.view.transform = t1; 

    if (should_hide_status_bar) 
    { 
     [[UIApplication sharedApplication] setStatusBarHidden:is_going_to_open withAnimation:(UIStatusBarAnimationSlide)]; 
    } 
} 
completion:^(BOOL finished) 
{ 
    self->_flags.is_sliding    = NO; 
    self.view.userInteractionEnabled = YES; 
}]; 

enter image description here

관련 문제