1
我有一個UIActivityViewController
與3種不同類型的活動項目。UIActivityViewController:活動項目配置
NSString
,UISimpleTextPrintFormatter
和UIImage
。
當我嘰嘰喳喳,Facebook或發送郵件系統總是添加字符串和圖像,但是當我打印系統使用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];