【发布时间】:2026-02-13 01:00:01
【问题描述】:
我正在尝试打开电子邮件视图控制器 (MFMailComposeViewController),我阅读的所有内容都建议使用 presentModalViewController:animated:,这似乎需要发送到 UIViewController。
例如,在the documentation 中,它说:
调用当前视图控制器的
presentModalViewController:animated:方法,传入你要模态呈现的视图控制器。
但我没有“当前视图控制器”!我的应用程序完全是 OpenGL,我的设置代码如下所示:
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.view = [[IPhoneView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[window addSubview: self.view];
[window makeKeyAndVisible];
我在 IPhoneView 类中设置了 OpenGL 上下文。
我发现许多questions 询问如何从UIView 获得UIViewController,而共识似乎是:不要。那么如何使用漂亮的滑动动画打开电子邮件视图控制器呢?
【问题讨论】:
标签: iphone uiview uiviewcontroller mfmailcomposeviewcontroller