Skip to content

Commit 3967436

Browse files
LP-10807: Fix for the safe area for bottom padding (#313)
1 parent 5f7d9d4 commit 3967436

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Leanplum-SDK/Classes/LPMessageTemplates.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,11 +1145,19 @@ - (void)updateNonWebPopupLayout:(int)statusBarHeight
11451145
_popupView.frame.size.width / 2,
11461146
textSize.height + 2*LPMT_TWO_BUTTON_PADDING);
11471147
} else {
1148+
CGFloat acceptButtonY;
1149+
LPActionContext *context = _contexts.lastObject;
1150+
if ([context.actionName isEqualToString:LPMT_INTERSTITIAL_NAME]) {
1151+
acceptButtonY = _popupView.frame.size.height - textSize.height - 3*LPMT_ACCEPT_BUTTON_MARGIN - [self safeAreaInsets].bottom;
1152+
} else {
1153+
acceptButtonY = _popupView.frame.size.height - textSize.height - 3*LPMT_ACCEPT_BUTTON_MARGIN;
1154+
}
11481155
_acceptButton.frame = CGRectMake(
11491156
(_popupView.frame.size.width - textSize.width - 2*LPMT_ACCEPT_BUTTON_MARGIN) / 2,
1150-
_popupView.frame.size.height - textSize.height - 3*LPMT_ACCEPT_BUTTON_MARGIN - [self safeAreaInsets].bottom,
1157+
acceptButtonY,
11511158
textSize.width + 2*LPMT_ACCEPT_BUTTON_MARGIN,
11521159
textSize.height + 2*LPMT_ACCEPT_BUTTON_MARGIN);
1160+
11531161
}
11541162
_titleLabel.frame = CGRectMake(LPMT_ACCEPT_BUTTON_MARGIN, LPMT_ACCEPT_BUTTON_MARGIN + statusBarHeight,
11551163
_popupView.frame.size.width - LPMT_ACCEPT_BUTTON_MARGIN * 2, LPMT_TITLE_LABEL_HEIGHT);

0 commit comments

Comments
 (0)