Daltron / NotificationBanner

The easiest way to display highly customizable in app notification banners in iOS
MIT License
4.78k stars 662 forks source link

StatusBarNotificationBanners label moves to right corner on orientation change. #330

Closed aman-at-appinventiv closed 3 years ago

aman-at-appinventiv commented 3 years ago

My app does not support landscape mode and still if the user tilts their phone in any direction the label inside the StatusBarNotificationBanners moves itself from the centre to the right corner of the banner.

The banner does not have more than 2 words at any given time and this is how it is being initialised StatusBarNotificationBanner(title: "Connecting...", style: .warning)

Pod version 3.0.2 The issue can be reproduced on any device with iOS 12 and above.

Szymon-Gesicki commented 3 years ago

+1

aman-at-appinventiv commented 3 years ago

Hey Guys, It's been a while, does anyone have a solution for this.

Thanks in advance.

Daltron commented 3 years ago

@aman836 Could you provide a video/gif of what you are experiencing please along with the code snippet you are using to show the banner? I'm not able to reproduce the issue currently.

aman-at-appinventiv commented 3 years ago

@Daltron Thank you for responding, please find the code snippet and GIF attached below. 😊

private var banner: StatusBarNotificationBanner? = nil func updateBanner(withStatus status: String) { switch status { case "connected": banner?.dismiss() banner = StatusBarNotificationBanner(title: "You're back on!", style: .success) banner?.show() case "connecting": banner?.dismiss() banner = StatusBarNotificationBanner(title: "Connecting...", style: .warning) banner?.autoDismiss = false banner?.show() case "disconnected": banner?.dismiss() banner = StatusBarNotificationBanner(title: "You are offline", style: .danger) banner?.autoDismiss = false banner?.show() case "notConnected": banner?.dismiss() banner = StatusBarNotificationBanner(title: "You are offline", style: .danger) banner?.autoDismiss = false banner?.show() case "syncing": banner?.dismiss() banner = StatusBarNotificationBanner(title: "Syncing...", style: .info) banner?.autoDismiss = false banner?.show() default: break } }

IMG_0006 TRIM

Daltron commented 3 years ago

Thanks for the GIF @aman836! I was able to reproduce the issue and this should now be fixed in the 3.0.6 release! Thank you for reporting this!