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

interactive dismiss event is not continuous update keyboard height. #105

Open
thecsy opened this issue Jan 21, 2021 · 1 comment
Open

interactive dismiss event is not continuous update keyboard height. #105

thecsy opened this issue Jan 21, 2021 · 1 comment

Comments

@thecsy
Copy link

thecsy commented Jan 21, 2021

interactive dismiss event is not continuous update keyboard height.
just one height Update, in start & end point.

i used storyboard & autolayout.
i need continuous visible Keyboard height. how to use ?

스크린샷 2021-01-21 오후 12 26 45

Simulator Screen Shot - iPhone 8 Plus - 2021-01-21 at 12 24 49

@thecsy thecsy changed the title not update visible height, just start & end Height update interactive dismiss event is not continuous update keyboard height. Jan 21, 2021
@kyrie-siu
Copy link

I met the same issue and I finally fixed it.

In my case, I had add a new UIWindow in my app then the panGestureRecognizer from RxKeyboard didn't added to the correct window.

Here is my solution by editing source code to make sure I am getting the keyWindow:

if let window = UIApplication.shared.windows.first(where: { (window) -> Bool in window.isKeyWindow}) {
    window.addGestureRecognizer(self.panRecognizer)
} else {
    UIApplication.rx.didFinishLaunching // when RxKeyboard is initialized before UIApplication.window is created
        .subscribe(onNext: { _ in
          if let window = UIApplication.shared.windows.first(where: { (window) -> Bool in window.isKeyWindow}) {
            window.addGestureRecognizer(self.panRecognizer)
          }
    }).disposed(by: disposeBag)
}

If you don't want to modify the source code, call RxKeyboard.instance after setting a new window should solve the issue as well:

window = UIWindow(frame: UIScreen.main.bounds)
window?.makeKeyAndVisible()
RxKeyboard.instance

Hope that could help!

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

2 participants