How to customize the UIAlertView?

2

Scenery:

Make changes to colors, and buttons of UIAlertView . How to use images to make this customization. For example: Add background image, and change the color of the locked screen behind the alert.

If the question has become vague, or difficult to understand, just make a comment so that I can enter more information about the question.

    
asked by anonymous 30.09.2014 / 23:02

2 answers

4

To customize a UIAlertView , this being UIView any, you could simply create a subclass of this and make the changes you want, even overriding layoutSubviews: , as shown this tutorial.

And why could ? Because the chances of you being able to publish such an application are almost zero . See that in reference for this class there is a note about it, this class is private and should not be modified:

  

The UIAlertView class is intended to be used as-is and does not   support subclassing. The view hierarchy for this class is private and   must not be modified.

But like I said, UIViewAlert is UIView any, so you can make your own alert, that means from scratch, mount your view with the required buttons, background , overlay and delegates .

For this, the answer would be very broad involving several details, so I recommend you at least start from this idea and in the course of your development go clear.

I hope you have helped.

    
01.10.2014 / 13:45
0

Try using CustomIos7AlertView ( link ). It works great, even with ios 8.

    
04.03.2015 / 18:41