Share more than 5 images with UIActivityViewController

大兔子大兔子 提交于 2019-12-21 16:33:08

问题


I have integrated with UIActivityViewController for sharing images to Facebook:

NSArray* dataToShare = imageArray;  //This is my image array
activityViewController =
        [[UIActivityViewController alloc] initWithActivityItems:dataToShare
                                          applicationActivities:nil];
[[[self parentViewController] parentViewController] presentViewController:activityViewController animated:YES completion:nil];

Sharing is working fine, but there is a problem while sharing multiple images. If there are more than 5 images, it only shares the first 5; the rest are ignored. The same problem occurs while saving the images to the camera roll, but for mail composer, all the images are there.

How can I solve this issue?


回答1:


The behaviour is the same in Photos.app actually.

I'm not sure what the reasoning behind it is but that's how Apple does it as well in their own apps. so I'm guessing it is intended.




回答2:


Try this:

UIImage *imageToShare = [UIImage imageWithData:[NSData dataWithContentsOfURL:
              [NSURL URLWithString:[NSString stringWithFormat:@"%@", _iconUrl]]]];


来源:https://stackoverflow.com/questions/18868547/share-more-than-5-images-with-uiactivityviewcontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!