强行触发shouldAutorotateToInterfaceOrientation
2012-01-14 20:55 张智清 阅读(2031) 评论(1) 编辑 收藏 举报// 先可通过UIApplication的setStatusBarOrientation方法更改状态条方向
// 然后以下代码实现强制触发shouldAutorotateToInterfaceOrientation
UIWindow *window = [[UIApplication shareApplication] keyWindow];
UIView *view = [window.subviews objectAtIndex:0];
[view removeFromSuperview];
[window addSubview:view];