Skip to content

Commit 874c3e6

Browse files
committed
Fix alignment of toolbar better
1 parent 8672382 commit 874c3e6

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

Objective-C/TOCropViewController/TOCropViewController.m

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,18 @@ - (CGRect)frameForToolbarWithVerticalLayout:(BOOL)verticalLayout
281281

282282
CGRect frame = CGRectZero;
283283
if (!verticalLayout) { // In landscape laying out toolbar to the left
284-
frame.origin.x = insets.left;
285-
frame.origin.y = 0.0f;
286-
frame.size.width = kTOCropViewControllerToolbarHeight;
287-
frame.size.height = CGRectGetHeight(self.view.frame);
284+
if (@available(iOS 26.0, *)) {
285+
CGFloat minPadding = 8.0f;
286+
frame.origin.x = insets.left + minPadding;
287+
frame.origin.y = minPadding;
288+
frame.size.width = kTOCropViewControllerToolbarHeight;
289+
frame.size.height = CGRectGetHeight(self.view.frame) - (minPadding * 2.0f);
290+
} else {
291+
frame.origin.x = insets.left;
292+
frame.origin.y = 0.0f;
293+
frame.size.width = kTOCropViewControllerToolbarHeight;
294+
frame.size.height = CGRectGetHeight(self.view.frame);
295+
}
288296
}
289297
else {
290298
// On iOS 26, the safe area insets values are the same, however the default bottom value is so
@@ -297,7 +305,7 @@ - (CGRect)frameForToolbarWithVerticalLayout:(BOOL)verticalLayout
297305
// I've filed FB20413789 with Apple hoping that this can become a real solution in future.
298306
if (@available(iOS 26.0, *)) {
299307
if (insets.bottom > 0.0f) {
300-
insets.bottom = 24.0f;
308+
insets.bottom = 20.0f;
301309
} else {
302310
insets.bottom = 8.0f;
303311
}

0 commit comments

Comments
 (0)