[ios]MFMessageComposeViewController 等<MessageUI/MessageUI.h> 系统页面 禁旋转
查项目有需求 让系统弹出页面也不能旋转
实现思路
利用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