iPhone屏幕分辨率是320x460还是320x480? [英] Is an iphones screen resolution 320x460, or 320x480?

查看:60
本文介绍了iPhone屏幕分辨率是320x460还是320x480?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑.我没有状态栏,也不知道如何设置滚动视图的尺寸.是320 x 480还是320 x 460?因为当我将其拖到情节提要板上并填满整个屏幕时,它说是320 x 460,但是当我向其中添加子视图时,它们的位置就很奇怪,就像视图短了20像素之类.>

我只是有点困惑,因为当我的状态栏消失时,它不会重新调整视图大小,它只会使视图变短20像素,这真的没有道理,对吗?难道不是让它延长20像素而不是仅仅切断20像素吗?

解决方案

iPhone屏幕绝对是320x480.

您在情节提要板上遇到问题的原因是,有很多地方可以告诉您您没有状态栏.您需要跟踪所有这些对象(3?),并确保其没有显示状态栏.

最常见的问题是,在嵌套的viewController中将状态栏专门设置为off时,您可以在一个较早的viewControllers中打开或推断出状态栏.这将导致它没有状态栏,而是显示为460像素高.正如您在图像中看到的,它明显短了20个像素.那是因为segue告诉它,当提示出现时,即使它本身没有状态,也要在状态栏下显示它.如果我将模式从模式更改为推送,问题就消失了.或者,如果我将第一个viewController设置为没有statusBar,那么问题就消失了.另外请注意,在某些情况下,Xcode可能需要重新启动才能正确更新其图形情节提要.

还有一件事情

在代码或情节提要中设置隐藏状态栏的方式与在.info文件中将 UIStatusBarHidden 设置为 YES 的方式不同.如果您在其他任何地方隐藏它时都将其保留为空,则default.png将被剪切并在加载时显示状态栏,然后在应用程序启动完成后消失.因此,请务必将其隐藏在此处,以获得一致的用户体验.

代码

 -(BOOL)应用程序:(UIApplication *)应用程序didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{//应用程序启动后进行自定义的替代点.[应用程序setStatusBarHidden:YES];} 

I'm so confused. I don't have a status bar, and I don't know how to make my scroll view's dimensions. Is it 320 x 480, or 320 x 460? Because when I drag it out onto storyboard and it fills the entire screen it says it is 320 x 460, but then when I add subviews to it they get positioned strangely and so that it's like the views are 20 pixels short or something.

EDIT: I'm just a little confused because when my status bar goes away, it doesn't re adjust the view size, it just makes the view 20 pix shorter, which doesn't really make sense, right? Shouldn't it make it 20 pix longer instead of just cutting off 20 pix?

解决方案

The iPhone screen is 320x480 definitely.

The reason you're having an issue in storyboards is there are multiple places to tell it you don't have a status bar. You need to track down all of them (3?) and make sure it says no status bar.

The most common problem is that you have your status bar either on or inferred in one of your earlier viewControllers while you've exclusively set it to off in a nested viewController. This causes it not to have a status bar but show itself as 460 pixels high. as you can see in the image its clearly 20 pixels shorter. Thats because the segue is telling it that when its presented to present it "under" the status bar even though it doesn't have one itself. If I were to change the segue from a modal to push the problem goes away. Or if I set the first viewController to have no statusBar as well the problem goes away. Also note that Xcode can require a restart to properly update its graphical storyboard in some instances.

One More Thing

Also setting either in code or storyboards to hide the status bar isn't the same as setting the UIStatusBarHidden to YES in your .info file. If you left it to no while hiding it everywhere else your default.png will be clipped and show the status bar while loading then it will disappear once the app finishes launching. So be sure to hide it there as well for a consistent user experience.

Code

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.

    [application setStatusBarHidden:YES];
}

这篇关于iPhone屏幕分辨率是320x460还是320x480?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆