There seems to be no SDK support for this behavior. Two buttons in UIAlertView will always be displayed in horizontal layout.
UIAlertView . VerticalAlertView.
, UIAlertView .
VerticalAlertView.h :
#import <UIKit/UIKit.h>
@interface VerticalAlertView : UIAlertView
@end
VerticalAlertView.m:
#import "VerticalAlertView.h"
@implementation VerticalAlertView
- (void)layoutSubviews
{
[super layoutSubviews];
int buttonCount = 0;
UIButton *button1;
UIButton *button2;
for (UIView *view in self.subviews) {
if ([view isKindOfClass:[UIButton class]]) {
++buttonCount;
if (buttonCount == 1) {
button1 = (UIButton *)view;
} else if (buttonCount == 2) {
button2 = (UIButton *)view;
}
}
}
button1.frame = CGRectMake(button1.frame.origin.x, button1.frame.origin.y, CGRectGetMaxX(button2.frame) - button1.frame.origin.x, button1.frame.size.height);
button2.frame = CGRectMake(button1.frame.origin.x, CGRectGetMaxY(button1.frame) + 10, button1.frame.size.width, button2.frame.size.height);
self.bounds = CGRectMake(0, 0, self.bounds.size.width, CGRectGetMaxY(button2.frame) + 15);
}
@end
, UIAlertView:
[[[VerticalAlertView alloc] initWithTitle:@"Title"
message:@"This is an alert message!"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:@"Second Button", nil] autorelease] show];
:

EDIT:
( ), Apple - UIAlertView, . , . UIAlertView:
" UIAlertView , . ."