다음과 같은 코드 블록에 코드를 넣을 수 있습니다 :
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if ([self isPadPortrait]) {
// Your code for Portrait
// set frame here
} else if ([self isPadLandscape]) {
// Your code for Landscape
// set frame here
}
코드를 다음은 방향 변경 처리 소요됩니다 : 당신은있는 ScrollView의 autoresizingMask을 설정하고이 코드를 추가 할 수 있습니다
- (BOOL)isPadPortrait
{
return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad
&& (self.interfaceOrientation == UIInterfaceOrientationPortrait
|| self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown));
}
- (BOOL)isPadLandscape
{
return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad
&& (self.interfaceOrientation == UIInterfaceOrientationLandscapeRight
|| self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft));
}
감사합니다 - : –
프레임을'willAnimateRotationToInterfaceOrientation :'에 설정할 수 있습니다. 또 뭐가 필요하니? – Devang
나는 나와 함께 스크롤보기 만 있고 내용의 크기를 변경하려고합니다. 그렇게하는 방법? –