StackOverflow에 대한 첫 번째 질문이므로 지금 당장 답변을 찾으려고했지만 모든 적절한 조치를 취하지 않았다면 실례합니다.XCode에서 Interface Builder Object Coordinates를 설정하십시오.
iPhone이 세로 모드에서 가로 모드로 변경되면 인터페이스 작성기에서 UIView의 여러 객체 좌표를 변경하려고합니다. 그래서 뷰를 축척하고 싶지는 않지만 아이폰이 가로 모드로 바뀌면 모든 객체가 더 잘 맞을 수 있도록 객체를 재정렬하려고합니다. 현재 프로그래밍 방식으로 X, Y 좌표를 설정하는 방법을 찾고 있지만이를 수행하는 더 좋은 방법이 있다면 알려주십시오.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {
/* Move IBOutlets to different X,Y coordinates */
}
return YES;
좋은데, 어떻게 그 대상의 위치가 바뀌겠습니까? –
IB 출구 (http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/IB_UserGuide/CodeIntegration/CodeIntegration.html#//apple_ref/doc/uid/TP40005344-CH18)를 설정했다고 가정합니다. 'self.myLabel.frame = CGRectMake (10, 10, 200, 20)' – Brian
과 같이 객체의 프레임이나 센터를 설정하면됩니다. 고맙습니다! –