Skip to content

Commit f26009d

Browse files
committed
Merge branch 'master' into ios7
2 parents 2fc9e57 + f02659a commit f26009d

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ SIAlertView
33

44
An UIAlertView replacement with block syntax and fancy transition styles. As seen in [Grid Diary](http://griddiaryapp.com/).
55

6+
[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=Sumi-Interactive&url=https://github.com/Sumi-Interactive/SIAlertView&title=SIAlertView&tags=github&category=software)
7+
68
## Preview
79

810
![SIAlertView Screenshot](https://github.com/Sumi-Interactive/SIAlertView/raw/master/screenshot.png)

SIAlertView/SIAlertView.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ typedef NS_ENUM(NSInteger, SIAlertViewBackgroundStyle) {
2424
SIAlertViewBackgroundStyleSolid,
2525
};
2626

27+
typedef NS_ENUM(NSInteger, SIAlertViewButtonsListStyle) {
28+
SIAlertViewButtonsListStyleNormal = 0,
29+
SIAlertViewButtonsListStyleRows
30+
};
31+
2732
typedef NS_ENUM(NSInteger, SIAlertViewTransitionStyle) {
2833
SIAlertViewTransitionStyleSlideFromBottom = 0,
2934
SIAlertViewTransitionStyleSlideFromTop,
@@ -42,6 +47,7 @@ typedef void(^SIAlertViewHandler)(SIAlertView *alertView);
4247

4348
@property (nonatomic, assign) SIAlertViewTransitionStyle transitionStyle; // default is SIAlertViewTransitionStyleSlideFromBottom
4449
@property (nonatomic, assign) SIAlertViewBackgroundStyle backgroundStyle; // default is SIAlertViewButtonTypeGradient
50+
@property (nonatomic, assign) SIAlertViewButtonsListStyle buttonsListStyle; // default is SIAlertViewButtonsListStyleNormal
4551

4652
@property (nonatomic, copy) SIAlertViewHandler willShowHandler;
4753
@property (nonatomic, copy) SIAlertViewHandler didShowHandler;

SIAlertView/SIAlertView.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ - (void)validateLayout
757757
if (y > CONTENT_PADDING_TOP) {
758758
y += GAP;
759759
}
760-
if (self.items.count == 2) {
760+
if (self.items.count == 2 && self.buttonsListStyle == SIAlertViewButtonsListStyleNormal) {
761761
CGFloat width = (self.containerView.bounds.size.width - CONTENT_PADDING_LEFT * 2 - GAP) * 0.5;
762762
UIButton *button = self.buttons[0];
763763
button.frame = CGRectMake(CONTENT_PADDING_LEFT, y, width, BUTTON_HEIGHT);
@@ -796,7 +796,7 @@ - (CGFloat)preferredHeight
796796
if (height > CONTENT_PADDING_TOP) {
797797
height += GAP;
798798
}
799-
if (self.items.count <= 2) {
799+
if (self.items.count <= 2 && self.buttonsListStyle == SIAlertViewButtonsListStyleNormal) {
800800
height += BUTTON_HEIGHT;
801801
} else {
802802
height += (BUTTON_HEIGHT + GAP) * self.items.count - GAP;

0 commit comments

Comments
 (0)