- 1、本文档共2页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
iPhone 学习笔记
iPhone 学习笔记
如使添加一个ViewController?
如果创建的工程选择的是View_base,则不存在此问题,如果创建的Window-base的工程,则按下述方法做:
方法1:选择UIViewControllerSubClass,建立View的h和CPP文件,然后再建立同名的XIB文件.在Delegate文件中添加输出口,在Main的XIB文件中拖入一个View Controller 图标,将这个控件的类选为创建的类名(RootViewController),然后将按Control键,将Delegate图标拖向新添加的Controller图标,在弹出的输出口选在H文件里新加的指针.
在新添加的XIB文件中,类名依然先新建的类,同时将File owner 拖向View,确认选取View输出口.
在CPP文件里加入: [window addSubview:rootViewController.view];
方法二: 选择UIViewControllerSubClass,建立View的h和CPP文件,然后再建立同名的XIB文件. 在新添加的XIB文件中,类名依然先新建的类,同时将File owner 拖向View,确认选取View输出口.
rootViewController = [[RootViewController alloc] initWithNibName:@RootViewController bundle:[NSBundle mainBundle]];
[window addSubview:rootViewController.view];
这个是动态创建了RootView,上一个是利用XIB文件创建.
更新方法:
TNND,切记切记:
添加h和CPP文件,添加XIB文件,同名
查看MainWindow.xib,确保delegate 图标的View输出口,与所加的文件关联
查看ViewController图标,确保view和delegate关联,并且第四项为所添加的View的名称
查看新添加的XIB文件,查看其file owner,确保其与相关view关联,class id 为新建的类名.
代码添加见上面.
查询状态栏: [[UIApplication sharedApplication] statusBarFrame]
you can hide the status bar entirely. Use this UIApplication call:
[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO].
Alternatively, set the UIStatusBarHidden key to true/ in your application Info.plist file.
To run your application in landscape-only mode, set the status bar orientation to
landscape. Do this even if you plan to hide the status bar (that is, [[UIApplication
sharedApplication] setStatusBarOrientation:
UIInterfaceOrientationLandscapeRight]).
The UIScreen object acts as a stand in for the iPhone’s physical screen ([UIScreen
mainScreen]).The screen object maps view layout boundaries into pixel space. It
returns either the full screen size (bounds) or just the rectangle that applies to your
application (applicationFrame).This latter takes the size of your status bar and, if used,
any toolbars/navigation bars into account.
文档评论(0)