2

我有UIActivityViewController3 种不同类型的活动项目。

NSString,UISimpleTextPrintFormatterUIImage.

当我在推特、脸书或作为邮件发送时,系统总是添加字符串和图像,但是当我打印系统时,UISimpleTextPrintFormatter除非我从NSArray. 我怎样才能告诉UIActivityViewController使用UIImage打印代替?

NSString *textToShare
= [NSString stringWithFormat:@"%@ %@ %i",
   _car.make,_car.model, _car.constructionYear];

UISimpleTextPrintFormatter *textDataToShare
= [[UISimpleTextPrintFormatter alloc] initWithText:textToShare];

UIImage* imageToShare = [UIImage imageNamed:_car.picture];

NSArray* items = @[textToShare,imageToShare,textDataToShare];

UIActivityViewController *activityViewController
= [[UIActivityViewController alloc]
   initWithActivityItems:items applicationActivities:nil];
4

1 回答 1

2

我认为这将回答您的问题:UIActivityViewController 中共享提供者的不同数据

于 2013-01-19T11:14:43.563 回答