Make custom item in UIActivityViewController icon brighter?

I am following the steps in How to create a custom UIActivity in iOS? Works as expected. It looks like iOS makes the metallic look and feel of all custom icons as well as its own "bookmarks", "print", etc. Is there anyway to make the icon bright?

+3


source to share


2 answers


As of iOS 6, this cannot be done.



Any color data for UIImage

returned by the method UIActivity

activityImage

will be ignored.

+2


source


On iOS 10, set the class property activityCategory

to .share. This will cause the activity icon to appear in color on the top bar of the UIActivityViewController.



In a subclass of UIActivity:

On iOS 10, set the class property activityCategory

to .share. This will cause the activity icon to appear in color on the top bar of the UIActivityViewController.



In a subclass of UIActivity:

class MyCustomActivity: UIActivity
{
    ...

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

    ...
}

      

+1


source







All Articles