Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIActivityViewController in iOS 7

In my app I have added these lines of codes to incorporate the functionality of uiactivityviewcontroller

    UIImage *yourImage = someImg;
    UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:[NSArray arrayWithObjects:@"abcdefgh",yourImage, nil] applicationActivities:nil];
    activityVC.excludedActivityTypes = @[ UIActivityTypeMessage ,UIActivityTypeAssignToContact,UIActivityTypeSaveToCameraRoll];
    [self presentViewController:activityVC animated:YES completion:nil]; 

and UIActivityViewContoller working fine, but the UI is like this: no FB icon, no Twitter icon and this is a screen-shot of an iPad:

screenshot of an iPad

However it is showing perfect UI in iOS 6. What might be the reason for this?

like image 280
Amitabha Avatar asked Sep 19 '13 12:09

Amitabha


People also ask

What is Uiactivityviewcontroller in Swift?

A view controller that you use to offer standard services from your app.

How is the title of a Uiactivityviewcontroller set?

The title that appears at the top of the the UIActivityItemController is intially simply, "/", with no subtitle, and then after about a second it changes to, "System@snap-2237692", with a subtitle of "File", as per the screenshot below.

What is a UIViewController?

A UIViewController is an object which manages the view hierarchy of the UIKit application. The UIViewController defines the shared behavior and properties for all types of ViewController that are used in the iOS application. The UIViewController class inherits the UIResponder class.


2 Answers

Let me tell you that your code is correct, after some test finally I could fix it, just go to Settings add Social Accounts (Facebook - Twitter - Flickr - Mail), run again your app and you will see the icons. Regards from Cancun! enter image description here

like image 188
Darío Gutiérrez Avatar answered Nov 13 '22 12:11

Darío Gutiérrez


Are you using the Simulator? In my experience, UIActivityViewController the UI is buggy in the simulator, but if you test on an actual device, it runs fine.

Try testing on a device.

like image 41
Nikola Kirev Avatar answered Nov 13 '22 10:11

Nikola Kirev