UIActivityController behaviour different on device and simulator

前端 未结 2 417
长情又很酷
长情又很酷 2021-01-15 18:40

I add an activityViewController to my app like below, passing in an image

UIActivityViewController *avc = [[UIActivityViewController alloc]initWithActivityIt         


        
2条回答
  •  鱼传尺愫
    2021-01-15 18:55

    I think you want to show some certain service only in your UIActivityViewController. You may one property called excludedActivityTypes to be defined as below to avoid some default activity.

    UIActivityViewController *yourvc = [[UIActivityViewController alloc]initWithActivityItems:[NSArray arrayWithObjects:img,nil] applicationActivities:[NSArray arrayWithObjects:nil]];
    yourvc.excludedActivityTypes = @[UIActivityTypePostToWeibo,UIActivityTypePrint,UIActivityTypeMail,UIActivityTypeCopyToPasteboard];//Try this code in simulator.. you can only see FB & Twitter.  
            [self presentModalViewController:yourvc animated:YES];
            [avc release];
    

    likewise you can excluded from default UIActivityViewController..

提交回复
热议问题