1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
//ios<6.0
- (
BOOL
)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
//return ;
}
//ios>6.0
- (
BOOL
)shouldAutorotate
{
//return;
}
- (
NSUInteger
)supportedInterfaceOrientations
{
// return
}
但如果想要控制“UINavigationController”直接在Contoller中使用这三个方法,将会不起作用,原因是ios6中“UINavigationController”并不支持- (BOOL)shouldAutorotate、- (NSUInteger)supportedInterfaceOrientations个方法,如果您想要控制其旋转,必须为其添加一个category,使其支持这个三个方法。
然后 用这个navController来初始化rootVC ,并在VC在写上如上3个方法,就可以控制它们的单独旋转方向了。
|
在ios6中“屏幕旋转控制”支持 nav Push某个vc单独旋转
最新推荐文章于 2023-01-18 11:22:32 发布
在ios6中如果要实现设备“屏幕旋转”的效果,需要在该Controller中使用以下三个方法: