我正在使用需要允许以适合 iPhone 5 屏幕的视图,但是我似乎无法正确布局,我已经尝试过了;
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone )
{
if (IS_IPHONE5) {
NSLog(@"iPhone 5");
[SelectionPhotoOptionView setFrame:CGRectMake(470, 0, 640, 568)];
[SelectionButView setFrame:CGRectMake(0, 0, 640, 568)];
[imageViewSelection setFrame:CGRectMake(0, 0, 640, 568)];
[imageViewPhotoOption setFrame:CGRectMake(-470, 0, 640, 568)];
ButtonYpos=612;
} else {
NSLog(@"iPhone 4 and Lower");
[SelectionPhotoOptionView setFrame:CGRectMake(470, 0, 320, 480)];
[SelectionButView setFrame:CGRectMake(0, 0, 320, 480)];
[imageViewSelection setFrame:CGRectMake(0, 0, 320, 480)];
[imageViewPhotoOption setFrame:CGRectMake(-470, 0, 320, 480)];
ButtonYpos=412;
}
顶部是错误的,iPhone 5 的布局不正确,我想知道是否有人可以帮助我提供一个更简洁的代码示例来使用?
谢谢,克里斯