我有EAGLView
,我正在从 glReadPixels 获取eaglview的屏幕截图。它正在工作并保存到相册,我需要与社交分享。所以,我使用了UIActivityViewController
。当我在EAGLView
内使用它时,我没有presentViewController
的可见界面。
UIImage *glImage = [self glToUIImage];
UIImage *screensht = [self createSavableImage:glImage];
NSArray *activityItems = @[screensht];
UIActivityViewController *avc = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
avc.excludedActivityTypes = [NSArray arrayWithObjects:UIActivityTypePrint, UIActivityTypeCopyToPasteboard, UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll, nil];
[self presentViewController:avc animated:YES completion:nil];
答案 0 :(得分:0)
presentViewController:animated:completion:
是UIViewController类的方法,而不是UIView或其子类。代码最后一行中的self
指向您的EAGLView实例。