This can solve your problem a lot easier and more flexible. https://github.com/wimagguc/ios-custom-alertview
AddSubview is not available on UIAlertView with iOS7. The presentation hierarchy for this class is private and should not be changed.
As a solution, this class creates a dialog box such as iOS, which can be expanded using any UIView or buttons. The animation and appearance are also copied, and no images or other resources are needed.
source share