欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

iOS只分享到微博的解决方法

程序员文章站 2022-03-04 20:30:46
...

很简单,利用iOS6的UIActivityViewController

- (IBAction)btn:(id)sender {

    NSArray *activityItems = [[NSArray alloc]initWithObjects:@"分享内容",@"http://www.oschina.net/",[UIImage imageNamed:@"love.png"], nil];
    
    UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
    activityViewController.excludedActivityTypes = @[UIActivityTypeAssignToContact, UIActivityTypeMessage,
                                                     UIActivityTypeSaveToCameraRoll, UIActivityTypePrint, 
                                                     UIActivityTypeCopyToPasteboard];
    
    [self presentViewController:activityViewController animated:YES completion:NULL];
    
}







转载于:https://my.oschina.net/kevinvane/blog/136004

上一篇: vbs脚本

下一篇: vbs (三)