mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-15 02:17:32 +00:00
Merge pull request #2560 from keymanapp/fix/ios/keyboard-margins-pre-ios11
fix(ios): Fixes margins on keyboard in iOS 9/10
This commit is contained in:
commit
963e891c94
2 changed files with 18 additions and 3 deletions
|
|
@ -74,9 +74,11 @@ private class CustomInputView: UIInputView, UIInputViewAudioFeedback {
|
|||
let innerView = keymanWeb.view!
|
||||
|
||||
var guide: UILayoutGuide
|
||||
var conditionalGuide: Bool = false
|
||||
|
||||
if #available(iOSApplicationExtension 11.0, *) {
|
||||
guide = self.safeAreaLayoutGuide
|
||||
conditionalGuide = true
|
||||
} else {
|
||||
guide = self.layoutMarginsGuide
|
||||
}
|
||||
|
|
@ -84,11 +86,21 @@ private class CustomInputView: UIInputView, UIInputViewAudioFeedback {
|
|||
// Fallback on earlier versions
|
||||
innerView.topAnchor.constraint(equalTo: guide.topAnchor).isActive = true
|
||||
innerView.bottomAnchor.constraint(equalTo: guide.bottomAnchor).isActive = true
|
||||
innerView.leftAnchor.constraint(equalTo: guide.leftAnchor).isActive = true
|
||||
innerView.rightAnchor.constraint(equalTo: guide.rightAnchor).isActive = true
|
||||
if conditionalGuide {
|
||||
innerView.leftAnchor.constraint(equalTo: guide.leftAnchor).isActive = true
|
||||
innerView.rightAnchor.constraint(equalTo: guide.rightAnchor).isActive = true
|
||||
} else {
|
||||
innerView.leftAnchor.constraint(equalTo: self.leftAnchor).isActive = true
|
||||
innerView.rightAnchor.constraint(equalTo: self.rightAnchor).isActive = true
|
||||
}
|
||||
|
||||
// Allow these to be broken if/as necessary to resolve layout issues.
|
||||
let kbdWidthConstraint = innerView.widthAnchor.constraint(equalTo: guide.widthAnchor)
|
||||
var kbdWidthConstraint: NSLayoutConstraint
|
||||
if conditionalGuide {
|
||||
kbdWidthConstraint = innerView.widthAnchor.constraint(equalTo: guide.widthAnchor)
|
||||
} else {
|
||||
kbdWidthConstraint = innerView.widthAnchor.constraint(equalTo: self.widthAnchor)
|
||||
}
|
||||
kbdWidthConstraint.priority = .defaultHigh
|
||||
kbdWidthConstraint.isActive = true
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
# Keyman for iPhone and iPad Version History
|
||||
|
||||
## 2020-02-03 13.0.63 beta
|
||||
* Bug fix: Fixes keyboard widths/margins in iOS 9 and 10 (#2560)
|
||||
|
||||
## 2020-01-30 13.0.62 beta
|
||||
* Feature: Initial keyboard setup process simplified with direct Settings link [iOS 11.0+ only] (#2548)
|
||||
* Bug fix: System keyboard now respects "Sounds > Keyboard Clicks" setting (#2550)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue