我创建了一个UIView
,有两个xibs
支持 iphone5 和 iphone4。视图宽度为 (iphone5 - 470) 和 (iphone5 - 400)。我已通过检查 iphone5 或 iphone4 的条件来初始化此视图。但是在运行应用程序时,它似乎占用了iphone5。
CategoryView *puzzleView = [[CategoryView alloc] initWithFrame:CGRectMake(0, startY, levelScrollView.frame.size.width, 190)];
BOOL isiPhone = IS_IPHONE5([[UIScreen mainScreen] bounds].size.height);
if (isiPhone)
{
puzzleView = [[[NSBundle mainBundle] loadNibNamed: @"CategoryView5" owner:self options:nil] objectAtIndex:0];
}
else
{
puzzleView = [[[NSBundle mainBundle] loadNibNamed: @"CategoryView-iphone" owner:self options:nil] objectAtIndex:0];
}