在iPhone应用程序上隐藏状态栏的问题,包括屏幕截图 [英] Problem with hiding status bar on iphone app, screenshot included

查看:193
本文介绍了在iPhone应用程序上隐藏状态栏的问题,包括屏幕截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试隐藏状态栏时出现蓝线,我在RootViewController的touchesBegan方法中使用以下行

Im getting this blue line when i try to hide the status bar, I'm using the following line in the touchesBegan method in my RootViewController

[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];

http://i.stack.imgur.com/GBCgX.png

推荐答案

Thiis非常简单.忘记编码了.刚开始就做就可以了,这使它变得更加简单和混乱.我一直在为我创建的每个应用程序执行此操作.

Thiis is really simple. forget about coding it. just do it right at the beginning this make it a lot more simple and less messier. I do it all the time for every single application I've created.

使用xcode进入您的项目,然后在组和文件"部分中找到一个名为yourapplicationname-info.plist的文件.

Go into your project in xcode, then in the Groups and Files section find a file called yourapplicationname-info.plist.

双击该复选框,然后打开一个框.它以表格的形式包含文件的属性.单击最后一行一次,以便最后一行以蓝色突出显示.单击右端的加号箭头.这将添加一个新行.出现一个列表,向下滚动至状态栏最初处于隐藏状态,然后单击Enter以将其选中.然后,该名称旁边会出现一个空框.选中该框,然后单击CDM + S保存该列表.关闭包装盒,然后回到xcode.现在,在试图隐藏状态栏的地方取消代码.

Double cick that and a box opens. It contains properties for your file in the form of a table. Click on the last row once so that the last row is highlighted in blue. Click on the plus arrow on the right end. This will add a new row. A list appears, scroll down to Status bar is initially hidden and click enter to select it. Then an empty box appears next to the name. Tick the box and click CDM+S to save the plist. close the box and get back into xcode. Now take your code off where you try to hide the status bar.

然后单击该视图,.xib文件,然后用鼠标单击实际视图,以使其处于焦点(我们当前正在查看的窗口)中.然后按cmd + 3打开属性部分.在状态栏显示的地方,选择选项,然后选择未指定.现在,这将摆脱uiview上的状态栏.选择该优化后可能发生的事情是将实际视图的大小减小20个像素.多数民众赞成在状态栏的高度.您要做的是重新调整视图以补偿缺少的状态栏.因此,尽管我们仍将视野作为重点.按cmd + 3,将打开视图大小.将H(高度)从300更改为320.这将通过添加20个像素(使我们失去状态栏而丢失)来对屏幕进行调整.然后保存并关闭界面生成器并完成操作.

Then click on the view, the .xib file and click with your mouse the actual view so it is in focus (the window that we are currently looking at). Then hit cmd+3 to open up the attributes section. Where it says status bar select the option and select unspecified. Now this will get rid of the status bar on the uiview. What might happen after selecting that optiion is decrease the size of the actual view by 20 pixels. thats the height of the status bar. what you want to do is readjust the view to compensate for the missing status bar. so while still having the view in our focus. hit cmd+3 this will open up the view size. change the H (height) from 300 to 320. And this will readust the screen by adding the 20 pixels which we lost by removing the status bar. Then save and close interface builder and youre done.

希望这会有所帮助 让我知道是否可以.谢谢

Hope this helps Let me know if it does. Thanks

PK

这篇关于在iPhone应用程序上隐藏状态栏的问题,包括屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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