Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIActivityViewController with custom UIActivity displays color image as gray

I created a custom UIActivity to display in a share sheet. I created an 60x60 icon (png file) in full color, but when it's displayed it only shows the outline in gray. I don't see what I've written incorrectly. I hope someone sees what I've missed. Any help will be greatly appreciated. Here is my code...

@implementation MyActivity

#pragma mark - Overrides
- (NSString *)activityType {
    return @"MyType";
}

- (NSString *)activityTitle {
    return @"ShareMe";
}

- (UIImage *)activityImage {
    return [UIImage imageNamed:@"MyIcon_60x60.png"];
}

- (BOOL)canPerformWithActivityItems:(NSArray *)activityItems {
    return YES;
}

- (void)prepareWithActivityItems:(NSArray *)activityItems {
    // Do Something
}

+ (UIActivityCategory)activityCategory {
    return UIActivityCategoryShare;
}

@end
like image 500
Rob Avatar asked Jan 02 '14 20:01

Rob


1 Answers

Try adding an underscore to the method in the subclassed UIActivity class

- (UIImage *)_activityImage {}

You lose the rounded grey bounding box though

like image 112
Ryan Berg Avatar answered Nov 03 '22 21:11

Ryan Berg