- 浏览: 1212374 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
lankk:
lankk 写道事实上,在运行String s1=new St ...
理解String 及 String.intern() 在实际中的应用 -
lankk:
事实上,在运行String s1=new String(&qu ...
理解String 及 String.intern() 在实际中的应用 -
lankk:
同意1楼的说法http://docs.oracle.com/j ...
理解String 及 String.intern() 在实际中的应用 -
raoyutao:
...
jdk 线程池 ThreadPoolExecutor -
hongdanning:
理解了。之前困惑的一些明白了。谢谢分享。
理解String 及 String.intern() 在实际中的应用
iOS 6 对设备转向时 View Rotations 的处理完全不一样了
Handling View Rotations
In iOS 6, your app supports the interface orientations defined in your app’s Info.plist
file. A view controller can override thesupportedInterfaceOrientations
method to limit the list of supported orientations. Generally, the system calls this method only on the root view controller of the window or a view controller presented to fill the entire screen; child view controllers use the portion of the window provided for them by their parent view controller and no longer participate in directly in decisions about what rotations are supported. The intersection of the app’s orientation mask and the view controller’s orientation mask is used to determine which orientations a view controller can be rotated into.
You can override the preferredInterfaceOrientationForPresentation
for a view controller that is intended to be presented full screen in a specific orientation.
In iOS 5 and earlier, the UIViewController
class displays views in portrait mode only. To support additional orientations, you must override the shouldAutorotateToInterfaceOrientation:
method and return YES
for any orientations your subclass supports. If the autoresizing properties of your views are configured correctly, that may be all you have to do. However, the UIViewController
class provides additional hooks for you to implement additional behaviors as needed. Generally, if your view controller is intended to be used as a child view controller, it should support all interface orientations.
When a rotation occurs for a visible view controller, the willRotateToInterfaceOrientation:duration:
,willAnimateRotationToInterfaceOrientation:duration:
, and didRotateFromInterfaceOrientation:
methods are called during the rotation. The viewWillLayoutSubviews
method is also called after the view is resized and positioned by its parent. If a view controller is not visible when an orientation change occurs, then the rotation methods are never called. However, theviewWillLayoutSubviews
method is called when the view becomes visible. Your implementation of this method can call thestatusBarOrientation
method to determine the device orientation.
Note: At launch time, apps should always set up their interface in a portrait orientation. After theapplication:didFinishLaunchingWithOptions:
method returns, the app uses the view controller rotation mechanism described above to rotate the views to the appropriate orientation prior to showing the window.
但假如你最上层的viewcontroller 是个tabviewcontroller又不一样了 你必须
@interface MyTabBarController : UITabBarController
{
}
@end
@implementation MyTabBarController
// put your shouldAutorotateToInterfaceOrientation and other overrides here
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
@end
参见: http://stackoverflow.com/questions/12410031/the-new-ios-rotations-supportedinterfaceorientations-doesnt-work
If your ViewController is a child of a UINavigationController or UITabBarController, then it is the parent that is your problem. You might need to subclass that parent view controller, just overriding those InterfaceOrientation methods as you've shown in your question
发表评论
-
手动编程 NSLayoutConstraint
2017-08-09 23:51 631项目中有个admob view是后期加上的 没写在st ... -
iOS autolayout 下 键盘 遮挡 处理 keyboard handler move up
2017-08-09 23:41 761在ios 中 由于键盘出现后会遮挡屏幕下面区域, ... -
iOS 开发一年多总结下
2012-12-19 16:47 1778收获很多 1. 一个人包办从构思, 设计, 实现, ... -
libxml2 xpath 解析含有 prefix namespace 的 xml
2012-11-06 13:28 3443有一段xml 里面有 prefix URL namespac ... -
ios5 支持 json 转化
2011-10-29 21:58 7400------ 解析json成dic对象 - ... -
Quartz 2D (ProgrammingWithQuartz) note
2011-10-09 20:03 2873http://www.evernote.com/shard/s ... -
ios 添加字体
2011-10-09 19:09 2044<!--?xml version="1.0&q ... -
MBProgressHUD 画不出来解决办法
2011-09-02 14:34 2192- (void)tableView:(UITabl ... -
ios googlemap 添加map overlay
2011-09-02 14:32 2839画线 CLLocationCo ... -
ios 系统相关
2011-09-02 14:28 1482判断当前设备 是否ipad #define ... -
ios 5 才执行的代码
2011-09-02 13:03 1254设置navigationBar背景在ios5有了官方支持 ... -
UIPopoverController 相关问题
2011-09-02 12:57 1535Popover + tableView 的宽度问题 ... -
Settings 设置问题
2011-09-02 12:05 9881. setting面板的设置只有当用户去了设置面 ... -
ios 国际化相关
2011-09-02 12:04 1749添加国际化 1. 代码中使用字符串的地方 使 ... -
UITableView 相关问题
2011-09-02 11:53 1886动态调整cell高度 - (UITable ... -
提取ipa png 图标
2011-08-10 11:19 6224Apple 对 iPhone 应用程序中的 png 图片进 ... -
个人申请 idp
2011-07-19 15:15 1719要准备的东西 一张双币信用卡(扣$99用) 一张可以接受外汇 ... -
本人第一款ios app上架了
2011-07-19 12:26 1484第一次开发ios app, 希望大家多多支持, 多多下载, ... -
MKPointAnnotation 导致的内存泄露
2011-07-11 21:59 1509程序是在一个map 上添加annotation, 添加的时候有 ... -
Grand Central Dispatch 笔记
2011-07-05 19:56 2492https://www.evernote.com/shard/ ...
相关推荐
iOS设备清单和各个iOS设备特性,从里面可以看出哪些设备支持蓝牙4.2,哪些支持蓝牙5.0,以及其他特性
全套的ios图标,png 64x64像素 适合b/s开发使用,如管理系统开发
ios项目适配ios6 ios7 注重页面属性的修改。
手把手教你把你的ios6的设备变成ios7
基于Java(SpringMVC+Hibernate +MySQL)的iOS移动设备管理(MDM)。 一、OpenMDMServer代码实现了如下功能: 1、自动创建基于设备的mobileconfig描述文件,安装时执行CheckIn和ServerURL自动设备注册; 2、获取...
如果是使用windows电脑来作ios设备的测试,还得专门找一台mac电脑来做这些事情,那是非常不方便的。本资源文件讲述了如果配置windows电脑,不需要mac电脑也能实现ios设备的安装测试包、提取日志、截图等功能
iphone越狱 ios6很好用 ios6.1.6也可以 ios6系列越狱
iOS 6 基础教程(Beginning iOS 6 Development )随书源码下载
彩虹猫高仿iOS6.mtz
Beginning iOS 6 Development Exploring the iOS SDK ios开发基础教程
iOS6可玩的滚动的天空,ipa软件包,旧版软件
IOS获取设备型号方法(包括iPhone6 & iPhone6 Plus) #import #import @interface DevicePlatform : NSObject //返回设备型号 如:iPhone4 或 iPhone6 + (NSString *)platform; //判断是不是iPhone6 + (BOOL)...
iOS的设备发展史,罗列了一系列变化,作为一个ios的开发人员,还是很有必要了解一下的。
这是 iOS 6 编程实战 全书的代码。。我找不到这本书的免费电子文档。。如果有找到这本书的电子文档的朋友请发我一份吧
在只知端口的情况下,ios设备通过遍历ip的方式udp连接pc端,使用syncsocket组件实现,
IOS设备类型获取PLIST struct utsname systemInfo; uname(&systemInfo); NSString *iOSDeviceModelsPath = [[NSBundle mainBundle] pathForResource:@"iOSDeviceModelMapping" ofType:@"plist"]; NSDictionary *...
ios6 越狱
IOS6状态栏透明
iOS6编程 pdf 中文 全部 全部章数都有 扫描版