Search code examples
iosobjective-cios7uialertviewsdcalertview

Size of UIAlertView


When creating an UIAlertView in code, the frame and bounds aren't calculated, yet. But even in the delegate method willPresentAlertView, there are still just zeros in the CGRects. Is there a way to determine an UIAlertView's size, or - as I only need its width - is the width of the view predetermined by iOS and the device?


Solution

  • In the comments you mention you want to add custom subviews to your alert. I wouldn't recommend this approach, but look at an alternative such as SDCAlertView (full disclosure: I wrote it).

    In any case, the width of an alert is 270 points.