Alan Moore
Alan Moore

Reputation: 6575

How do I change the tint color (background) of a UIActionSheet in iOS5?

I would like to change the tint color of my UIActionSheet for my iOS apps. Is there an easy answer or custom class which I can use to achieve this?

I have found help on changing the colors of the Action Sheet buttons which is helpful, but I haven't found anything about changing the background color.

Upvotes: 2

Views: 2549

Answers (3)

ishahak
ishahak

Reputation: 6795

I am not able to respond to the above comments. However the link provided by @Luke is broken, but I have found it to be active here: https://github.com/gpambrozio/BlockAlertsAnd-ActionSheets

Upvotes: 2

Kevin
Kevin

Reputation: 3131

There is no API, but you could subclass UIActionSheet and play around with its subviews array till you find the one that draws the background and either edit it directly, or add a subview to cover it up.

While this isn't the greatest approach, it isn't using any hidden APIs to it won't get rejected from the iTunes store. Before iOS 5, this is how most customization was done.

Here is a great example of doing it with Navbars.

Upvotes: 2

matt
matt

Reputation: 536026

There is no legal API for this, and if you use illegal API your app will be rejected from the app store. The simplest solution is to roll your own interface and not use UIActionSheet.

Upvotes: 0

Related Questions