2
내 앱에 두 개의보기가 있습니다. "계산기"와 "테이프". 나는 계산기 내부의 버튼을 클릭하여 테이프에 접근 할 수 있고 그 반대도 마찬가지입니다. 아래 코드에 따라 회전을 설정하면 대부분의 경우 잘 동작합니다.ios6의 자동 회전이 예상대로 작동하지 않습니다.
그러나 계산기보기 또는 테이프보기를 가로로 회전하면 다른보기에 액세스하려고 할 때 인터페이스가 모두 회전되어 해당 장치가 이미 회전 된 것을 인식하지 못하는 것처럼 문제가 발생합니다. 어떤 제안?
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation) toInterfaceOrientation duration:(NSTimeInterval)duration
{
[self doLayoutForOrientation:toInterfaceOrientation];
}
- (void)doLayoutForOrientation:(UIInterfaceOrientation)orientation {
if (UIInterfaceOrientationIsPortrait(orientation))
{
//set the frames here
}
else
{
//set the frames here
}
}
이미 회전 된보기에서 다른보기 (예 : 테이프)로 이동하면 장치가보기를 인식하지 못하는 것으로 인식됩니다. –
그래서 장치의 현재 방향을 확인해야 다음보기가 나타나고보기가 조정됩니다. –
위대한 작품은 꿈처럼 보입니다. –