내 앱에는 각보기에 3 개의 버튼과 1 개의 이미지보기가 있습니다. 탐색 막대 및 탭 막대 컨트롤러와 함께 단추 및 이미지의 크기로 인해 가로 모드에서 모든 것을 더 작게 만들려면 크기가 필요했습니다.iPhone이 회전 할 때 예상대로 작동하지 않습니다.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
viewofimage.frame = CGRectMake(130, 45, 220, 115);
share.frame = CGRectMake(205, 161, 70, 70);
invite.frame = CGRectMake(8, 161, 70, 70);
contact.frame = CGRectMake(402, 161, 70, 70);
invitation.frame = CGRectMake(3, 227, 81, 21);
sharing.frame = CGRectMake(200, 227, 81, 21);
contacting.frame = CGRectMake(397, 227, 81, 21);
}
else
{
viewofimage.frame = CGRectMake(20, 64, 280, 206);
invite.frame = CGRectMake(8, 285, 70, 70);
share.frame = CGRectMake(125, 285, 70, 70);
contact.frame = CGRectMake(242, 285, 70, 70);
invitation.frame = CGRectMake(3, 358, 81, 21);
sharing.frame = CGRectMake(120, 358, 81, 21);
contacting.frame = CGRectMake(237, 358, 81, 21);
}
return YES;
}
시뮬레이터에서는 시뮬레이터에서이 기능이 완벽하게 작동하며 이미지 뷰의 크기가 조정되고 모든 것이 표시됩니다. 장치에서 모든 것을 위아래로 이동합니다. 코드에서 오류가 발생한 위치에 대한 의견이 있으십니까?
시도했지만, 이미지 뷰가 너무 커서 버튼을 클릭하는 것으로 끝났습니다. 이미지보기 맨 위 ... 가로보기 이미지보기에서 전체보기 화면 높이를 사용했습니다. – user717452