ITeye博客

[ios]MFMessageComposeViewController 等<MessageUI/MessageUI.h> 系统页面 禁旋转

119568242 · 2013-07-30 10:38 · ios · 移动开发 · Markdown

查项目有需求 让系统弹出页面也不能旋转

实现思路

利用category覆写MFMessageComposeViewController 的

 

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;)

(方法,ios 6则是另外2个方法)

 

代码

.h

@interface MFMessageComposeViewController(Portrait)

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;

 

@end

 

.m

@implementation MFMessageComposeViewController(Portrait)

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{

    return (interfaceOrientation == UIInterfaceOrientationPortrait);

}

 

@end

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。