2011-10-20 3 views
0

가로 모드로 iPad 응용 프로그램을 개발 중입니다. 모든보기 컨트롤러에서 return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);으로 설정했습니다. 하지만 다음 코드를 통해보기 프레임을 변경하면 변경되지 않으며 ipad의 전체 화면을 차지합니다.이 문제를 극복 할 수 있습니까? 어떤 도움을 주시겠습니까? view.frame도 시도했습니다.view.frame이 ipad에서 작동하지 않습니까?

-(IBAction)category_Click:(id)sender 
{ 

CGRect rect = _categoryController.view.bounds; 
rect.origin.x = 0; 
rect.origin.y = rect.origin.y; 
rect.size.width = 1024; 
rect.size.height = 650; 
_categoryController.view.bounds = rect; 
_categoryController.view.bounds = CGRectMake(rect.origin.x, rect.origin.y,1024, 650); 
[self presentModalViewController:_categoryController animated:YES]; 

} 
+2

처음에는. 'frame'에 대해서 말하지만 여러분의 코드는'bounds'에 관한 것입니다. – beryllium

+1

나는 둘 다 시도했다. 나는 나의 질문에서 언급 했는가? –

답변

1

당신이 후 프레임 을 조정 봤어 modalPresentationStyle 속성의 ViewController 제시? 나는 presentModalViewController:animated: 메서드가 때때로 프레임을 실행하는 동안 변경할 수 있다고 생각한다. 애니메이션이 끝날 때까지 기다려야 할 수도 있습니다.

가능하다면 _categoryController 클래스의 '- (void) viewDidAppear :'메서드에서보기의 프레임을 조정 해보십시오.

그러나 일반적으로 모달 뷰 컨트롤러의 모양을 부드럽게 변경하는 것은 어렵다는 것을 알게되었습니다.

0

확인

_categoryController.modalPresentationStyle = UIModalPresentationFormSheet; 
_categoryController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; 
[self presentModalViewController:_categoryController animated:YES]; 
_categoryController.view.superview.frame = CGRectMake(0, 0, 818, 739); 
_categoryController.view.superview.center = self.view.center; 
관련 문제