我已经创建了一个UIViewController的子类来处理横向模式,然后我将我的子类子类化,然后显示给用户。现在,我不想在横向视图中添加子类,并且其大小与横向视图相同,但为了获取框架,我需要添加操作
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
我也在我的第一个子类中使用过。但是,当我这样做时,它会忽略超类中的所有代码,并做一件事(获取框架)
[[UIScreen mainScreen].landscapeFrame
或类似的东西(如果存在)愚蠢的我,我忘了加[super didRotateFromInterfaceOrientation: fromInterfaceOrientation];
感谢Sanjay Chaudhry注意到了,谢谢! :)
答案 0 :(得分:2)
在覆盖方法中调用Super的方法:
[super didRotateFromInterfaceOrientation: fromInterfaceOrientation];