2015-01-23 9 views
0

childViewController 내부에서 UIPopOverController의 기본 콘텐츠 크기를 변경하려고합니다.PopOverViewController 기본 콘텐츠 크기를 변경시

은 첫째로 나는 이런 식으로 내 childViewController 즉 (DateViewController) 내부 그래서

DateViewController *dateView = [[DatePickerViewController alloc] initWithNibName:@"DateViewController" bundle:nil]; 

     UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:dateView]; 


     m_tableCell = (NotesCell *)[m_tableView cellForRowAtIndexPath:indexPath]; 


      popViewController = [[UIPopoverController alloc] initWithContentViewController:navController]; 
      popViewController.backgroundColor = [[AppManager instance].themeManager navigationBarColor]; 
      popViewController.delegate = self; 


       //the rectangle here is the frame of the object that presents the popover, 
       //in this case, the UIButton… 


       CGRect popRect = CGRectMake(m_tableCell.customView.frame.origin.x, 
              m_tableCell.customView.frame.origin.y, 
              m_tableCell.customView.frame.size.width, 
              m_tableCell.customView.frame.size.height); 
           [popViewController presentPopoverFromRect:popRect 
                inView:m_tableCell 
           permittedArrowDirections:UIPopoverArrowDirectionRight 
               animated:YES]; 

, 나는이 제대로 작동

- (void)toggleButton 
    { 
     if(small) 
     { 
       self.presentingViewController.presentedViewController.preferredContentSize = CGSizeMake(320,485); 
     } 
     else 
     { 
      self.presentingViewController.presentedViewController.preferredContentSize = CGSizeMake(320,320); 
     } 
} 

함수를 호출합니다 토글 버튼이를 PopOverViewController 제시하지만, 우리는 UIPopOverViewController에 화살표가 있음을 알고 있으므로 popOverView의 크기를 조정할 때 화살도 애니메이션으로 위아래로 움직입니다. 나는 이것을 이미지로 보여줄 수 없으므로 저를 용서해주십시오.

란짓을 도와 드릴까요.

답변

0

첫 번째로 게시 한 코드는 작동하지 않습니다. 왜냐하면 else 문에서 CGSizeMake를 지정하는 동안 구성하는 동안 하나의 값만 지정하기 때문입니다.

둘째는 popoverArrowDirection property

+0

안녕 내 타이핑 실수가, 지금 내 위의 질문을 확인하시기 바랍니다 지정하여 해당 화살표를 허용의 어느 방향으로 정의 할 수 있습니다. 안녕하세요, 이미 popOver로 표시되는 VC 안에 있습니다. 여기에서 어떻게 popOverArrowDirection 속성에 액세스 할 수 있습니까? – Ranjit

+0

첫 번째 쪽지는 단지 쪽지였습니다. 중요한 점은 내가 언급 한 화살표 방향입니다. –

+0

popOverVC를 표시 할 때 화살표 방향을 지정했습니다. 이제 popOver로 표시되는 VC 안에 있습니다. 이제 이것을 관리하는 방법. preferredContentSize를 변경하는 다른 방법은 무엇입니까? – Ranjit