iPhone和iPad的self.view.bounds.size.height不同值

iPhone和iPad的self.view.bounds.size.height不同值,iphone,objective-c,ipad,position,frame,Iphone,Objective C,Ipad,Position,Frame,好的,除了明显的维度差异之外,我认为我的代码中可能有一个逻辑错误导致了这种不一致性 我使用self.view.bounds.size.height来确定屏幕的底边,这就是不一致之处 作为参考,loadingView的大小始终一致 if (loading==TRUE) { [UIView animateWithDuration:0.25 animations:^{ [loadingView setFrame:CGRectMake(loadingView.fr

好的,除了明显的维度差异之外,我认为我的代码中可能有一个逻辑错误导致了这种不一致性

我使用
self.view.bounds.size.height
来确定屏幕的底边,这就是不一致之处

作为参考,
loadingView
的大小始终一致

if (loading==TRUE) {
        [UIView animateWithDuration:0.25 animations:^{
            [loadingView setFrame:CGRectMake(loadingView.frame.origin.x, self.view.bounds.size.height-loadingView.frame.size.height, loadingView.frame.size.width, loadingView.frame.size.height)];
        }];
    } else {
        [UIView animateWithDuration:0.25 animations:^{
            [loadingView setFrame:CGRectMake(loadingView.frame.origin.x, self.view.bounds.size.height+loadingView.frame.size.height, loadingView.frame.size.width, loadingView.frame.size.height)];
        }];
    }
我运行上述函数在屏幕的最底部显示和隐藏“页面加载”通知

这是我的问题:

iPad(正确):

iPhone(不正确):

现在,很明显这里有一个高度差,我不知道为什么它只出现在iPhone上,而不出现在iPad上


我正在努力使我的应用程序具有通用性,显然,我不希望在我的代码中进行大量的设备检查。必须有更优雅的方法来确定设备的底部边缘。

请确保
self.view
适合整个屏幕。(仔细检查IB中的自动调整大小掩码等)

您确定self.view覆盖了整个屏幕吗?您的评论将我带到了IB,我在那里检查了视图继承权。是啊,出事了。我调整了视图的大小,它立即修复了我的问题。把这个放在答案里,我会给你打分。很高兴,它成功了!谢谢你,伙计!感谢你帮我指出我自己的愚蠢!