我一體的共享選項到我的應用程序,一切似乎很好,我基本上排除了除消息,Twitter和Facebook的每一種類型的UIActivity的,當我測試,看看它的功能,我在看文本框夸克在UIActivityViewController整合
「我有一個新的高分!
com.apple.UIKit.activity.Message
com.apple.UIKit.activity.PostToFacebook
com.apple.UiKit.activity.PostToTwitter「。
和文字出現在每個活動。
反正是有刪除文本,或者它應該是這個樣子?
這裏是我的MainViewController的方法,它呈現UIActivityViewController。
-(void)sharedView {
APActivityProvider *APActivityPro = [[APActivityProvider alloc] init];
NSArray *activites = @[APActivityPro,UIActivityTypeMessage, UIActivityTypePostToFacebook, UIActivityTypePostToTwitter];
activityController = [[UIActivityViewController alloc] initWithActivityItems:activites applicationActivities:nil];
activityController.excludedActivityTypes = @[UIActivityTypePostToWeibo,
UIActivityTypeMail,
UIActivityTypePrint,
UIActivityTypeCopyToPasteboard,
UIActivityTypeAssignToContact,
UIActivityTypeSaveToCameraRoll,
UIActivityTypeAddToReadingList,
UIActivityTypePostToFlickr,
UIActivityTypePostToVimeo,
UIActivityTypePostToTencentWeibo,
UIActivityTypeAirDrop];
[self presentViewController:activityController animated:YES completion:nil];
[activityController setCompletionHandler:^(NSString *activityType, BOOL completed)
{
if (completed)
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@""
message:NSLocalizedString(@"Post Sent!",@"the confirmation of the sent message/post")
delegate:nil
cancelButtonTitle:NSLocalizedString(@"OK",@"done")
otherButtonTitles:nil];
[alert show];
}
}
];
}
而且我的代碼在我的APActivityProvider.m文件中。
-(id) activityViewController:(UIActivityViewController*)activityViewController
itemForActivityType:(NSString *)activityType
{
if ([activityType isEqualToString:UIActivityTypeMessage])
return NSLocalizedString(@"I got a new highscore!",@"Comment for message");
if ([activityType isEqualToString:UIActivityTypePostToFacebook])
return NSLocalizedString(@"I got a new highscore!",@"Comment for Facebook");
if ([activityType isEqualToString:UIActivityTypePostToTwitter])
return NSLocalizedString(@"I got a new highscore!",@"Comment for twitter");
return nil;
}
- (id) activityViewControllerPlaceholderItem:(UIActivityViewController *)
activityViewController
{
return @"";
}
我想我們需要看到一些源代碼才能給你答案。 – onnoweb
@onnoweb我在與我的問題相關的代碼中添加。 – Blank