3

I follow the steps in How can I create a custom UIActivity in iOS? It works as expected. It looks like iOS force a metallic look&feel for all custom icons as well as its own "Bookmark", "Print", etc. Anyway to make my icon colorful?

Community
  • 1
  • 1
Espina
  • 83
  • 7

2 Answers2

2

As of iOS 6, it is not possible to do this.

All color data for the UIImage that is returned by UIActivity's activityImage method will be ignored.

Bryan Luby
  • 2,527
  • 22
  • 31
1

In iOS 10, set the activityCategory class property to .share. This will cause the activity icon to appear in color in the top row of the UIActivityViewController.

In your UIActivity subclass:

In iOS 10, set the activityCategory class property to .share. This will cause the activity icon to appear in color in the top row of the UIActivityViewController.

In your UIActivity subclass:

class MyCustomActivity: UIActivity
{
    ...

    override open class var activityCategory: UIActivityCategory
    {
        get
        {
            return UIActivityCategory.share;
        }
    }

    ...
}
Paul
  • 11
  • 4