From ad7a9aee3db590dc4fd30bb3e98ede51a96a3dc8 Mon Sep 17 00:00:00 2001 From: Orkhan Alikhanov Date: Tue, 6 Nov 2018 19:43:58 +0400 Subject: [PATCH] Fixed snackbar laid out incorrectly --- Sources/iOS/SnackbarController.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sources/iOS/SnackbarController.swift b/Sources/iOS/SnackbarController.swift index 90ba3e641..80de48142 100644 --- a/Sources/iOS/SnackbarController.swift +++ b/Sources/iOS/SnackbarController.swift @@ -178,6 +178,16 @@ open class SnackbarController: TransitionController { open func reload() { snackbar.frame.origin.x = snackbarEdgeInsets.left snackbar.frame.size.width = view.bounds.width - snackbarEdgeInsets.left - snackbarEdgeInsets.right + snackbar.frame.size.height = snackbar.heightPreset.rawValue + snackbar.layoutEdgeInsets = .zero + if .bottom == snackbarAlignment { + snackbar.frame.size.height += bottomLayoutGuide.length + snackbar.layoutEdgeInsets.bottom += bottomLayoutGuide.length + } else { + snackbar.frame.size.height += topLayoutGuide.length + snackbar.layoutEdgeInsets.top += topLayoutGuide.length + } + rootViewController.view.frame = view.bounds layoutSnackbar(status: snackbar.status) }