0

I want to show two buttons in 'UIAlertview'. Because the button text is very long, I want the buttons to appear one above the other in a vertical stack instead of side by side. Is it possible to do this?

jrturton
  • 118,105
  • 32
  • 252
  • 268
user968571
  • 141
  • 1
  • 10

2 Answers2

0

Unfortunately your only choices are to either make the button text shorter or to add another button. UIAlertView only lays out rows of buttons when there are more than two.

Aside from that, you can subclass UIAlertView, but it would probably be easier to simply create your own custom view / view controller at that point.

greenisus
  • 1,707
  • 14
  • 17
0

You would need to subclass UIAlertView and create your own custom alert with the buttons as you described.

WrightsCS
  • 50,551
  • 22
  • 134
  • 186
  • From the class reference: 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. – Luke Nov 21 '11 at 19:57
  • @Luke your comment / link should be an answer. – WrightsCS Nov 21 '11 at 20:02
  • My comment isn't really an answer IMHO. The real answer would be to say "No" to the question - but then to recommend building a custom class of UIView's and the like to accomplish the effect of a customized UIAlertView. – Luke Nov 21 '11 at 20:07
  • If you still want to risk subclassing, here's how it could look like: http://stackoverflow.com/a/16526932/378977 – Flo May 13 '13 at 16:43