Closed kartikthapar closed 9 years ago
Indeed currently it's not supported. A PR to add this feature would be much appreciated.
I will try for a PR; but it will be quite minimalistic.
@kartikthapar feature added at 1.0.3 release
@ignasibm , horizontal eg
- (IBAction)showSuccessWithHorizontalButtons:(id)sender {
SCLAlertView *alert = [[SCLAlertView alloc] initWithNewWindow];
[alert setHorizontalButtons:YES];
SCLButton *button = [alert addButton:@"First Button" target:self selector:@selector(firstButton)];
button.buttonFormatBlock = ^NSDictionary* (void)
{
NSMutableDictionary *buttonConfig = [[NSMutableDictionary alloc] init];
buttonConfig[@"backgroundColor"] = [UIColor whiteColor];
buttonConfig[@"textColor"] = [UIColor blackColor];
buttonConfig[@"borderWidth"] = @2.0f;
buttonConfig[@"borderColor"] = [UIColor greenColor];
return buttonConfig;
};
[alert addButton:@"Second Button" actionBlock:^(void) {
NSLog(@"Second button tapped");
}];
[alert showSuccess:kSuccessTitle subTitle:kSubtitle closeButtonTitle:kButtonTitle duration:0.0f];
}
Currently, the buttons are stacked vertically. Adding a button changes frame dimensions for the alert's window. In an alert, you would expect to have 2 buttons stacked horizontally. So if simply there is a view style that enables that option; it would be great. Thanks