Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPhone X Landscape: Whisper uses wrong offset #197

Closed
Laptopmini opened this issue Nov 28, 2017 · 3 comments
Closed

iPhone X Landscape: Whisper uses wrong offset #197

Laptopmini opened this issue Nov 28, 2017 · 3 comments

Comments

@Laptopmini
Copy link

Laptopmini commented Nov 28, 2017

  • iPhone X
  • iOS 11.1
  • Xcode 9.1
  • Whisper 6.0.2

let whisperMessage = Whisper.Message(title: message, textColor: .white, backgroundColor: color)
Whisper.show(whisper: whisperMessage, to: navigationController)
@buscarini
Copy link

I'm seeing the same thing on iPad landscape

@pchmelar
Copy link

+1

@ivanorotondo
Copy link

I had a similar problem, this code could maybe help someone in the future.

My problem was that the whisper view origin.y was calculated wrong when in landscape (the navigation bar height gets smaller) and therefor there was an empty space between whisper and navigationbar.

I solved changing the code in WhisperFactory.swift:

func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
    ...

    
    if UIDevice.current.orientation.isLandscape {
        maximumY = 32
    } else {
        maximumY = 44
    }

    whisperView.frame.origin.y = maximumY
    ...
}

@3lvis 3lvis closed this as completed Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants