我创建了一个在按下导航栏上的按钮时调用的操作表。它显示 3 个按钮(发送到电子邮件、打印和取消)。现在我不知道当按下操作表中的“打印”按钮时如何让 iPhone 打印 uiwebview。谁能帮我 ?或者也许有一些示例代码给我?我正在使用带有情节提要和 iPhone 编程的最新 Xcode 4.3。提前致谢 !
user1528288
问问题
147 次
1 回答
0
改用 ActivitySheet...
UIImage *yourImage = [UIImage imageNamed:@"yourImage"]; //the image you want to print
NSArray *itemsToShare = @[yourImage];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:itemsToShare applicationActivities:nil];
activityVC.excludedActivityTypes = @[ UIActivityTypeCopyToPasteboard, UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll, UIActivityTypeMail, UIActivityTypeMessage, UIActivityTypePostToFacebook, UIActivityTypePostToTwitter, UIActivityTypePostToWeibo]; //or whichever you don't need >>> in this case we just have AirPrint
[self presentViewController:activityVC animated:YES completion:nil];
于 2013-07-19T18:28:35.210 回答