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?
Asked
Active
Viewed 1,712 times
0
-
1What do you mean by "one by one"? Paste some code some images – Alex Terente Nov 04 '11 at 15:42
-
You may consider http://cocoacontrols.com/platforms/ios/controls/tsalertview or have a browse on Github. – Luke Nov 21 '11 at 19:58
2 Answers
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
-
-
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