2011-09-16 1 views
0

오프라인으로 저장하면 주석을 오프라인으로 저장하고 주석을 편집 할 수있는 뷰 컨트롤러 (AddCommentViewController)가 있습니다.이상한 행동 ModalViewController

AddCommentViewController *addView = [AddCommentViewController new]; 

[addView setTitle:@"New Comment"]; 

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:addView]; 
[navController setModalPresentationStyle:UIModalPresentationFormSheet]; 

[delegate.navigationController presentModalViewController:navController animated:YES]; 
[delegate dismissPopOver:self animated:YES]; 
[navController release]; 
[addView release]; 

여기에 아무 문제, 뷰가 바닥에서 잘 애니메이션 : 나는 새로운 코멘트를 추가하고 오프라인으로 저장할보기에서 AddCommentViewController를로드 할 때

는 아무 문제가 없다. 그리고 해산되면 그것은 바닥까지 멋지게 움직입니다.

하지만 이제 문제가 발생했습니다.

다른보기에서 오프라인으로 저장된 모든 댓글의 목록을 볼 수 있습니다. AddCommentViewController를로드하면 이상한 일이 발생합니다.

왼쪽에서 움직이는보기 모달을 표시하려고하면 별난 위치 (가운데가 아니라 한쪽이지만 buttom 오른쪽)에서 멈 춥니 다. 내가 그것을 닫을 때,보기는 다시 왼쪽으로 애니메이션되고 다른보기는 초상화로 향하게됩니다. 나는 문제를 찾을 수 없습니다 및 코드는 거의 동일합니다 : 내가 가진 특정 방향에서보기를 강제로 시도

Comment *comment = [allComments objectAtIndex:indexPath.row]; 

AddCommentViewController *addView = [[AddCommentViewController alloc] initWithId:comment.identifier]; 

[addView setTitle:@"Change comment"]; 

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:addView]; 
[navController setModalPresentationStyle:UIModalPresentationFormSheet]; 
navController.navigationBar.tintColor = [UIColor P4aPurple]; 

[self presentModalViewController:navController animated:YES]; 

[navController release]; 
[addView release]; 

:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 
{ 
    return UIInterfaceOrientationIsLandscape(toInterfaceOrientation); 
} 

하지만 난이 오류 :

The view controller <UISplitViewController: 0x1843d0> returned NO from -shouldAutorotateToInterfaceOrientation: for all interface orientations. It should support at least one orientation. 

오프라인으로로드 할 때 장치를 세로로 잡고 있으면 올바르게 작동합니다. 당신은 세로 방향을 강제하려면

답변

0

는 고정, 그것은 분할의 상세 뷰 컨트롤러에 뷰가 분할 뷰 컨트롤러에 모달을 제시하는 것으로 나타났다하지 전망.

0

,이 시도 :

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{ 
    if (toInterfaceOrientation == UIInterfaceOrientationPortrait) 
     return YES; 
    else return NO; 
}