[WIP] [Fixed] iPhone X inputAccessoryView layout issue#209
Conversation
|
I can't believe apple didn't add native support for this so we don't have to |
nathantannar4
left a comment
There was a problem hiding this comment.
With the changes i made in my latest PR the color you will need is: messageInput.backgroundView.backgroundColor
| // iPhone X workaround | ||
| if #available(iOS 11.0, *) { | ||
| view.backgroundColor = messageInputBar.backgroundColor | ||
| bottom = messagesCollectionView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor) |
There was a problem hiding this comment.
I believe view.layoutMarginsGuide.bottomAnchor would work as well.
layoutMarginsGuide is available since iOS 9.
| open class MessageInputBar: UIView { | ||
|
|
||
| // MARK: - iPhone X Layout Fix | ||
| // Could be fixed by Apple soon |
There was a problem hiding this comment.
I don't think this is a bug. See my answer on the SO post for a cleaner fix.
|
I notice that when adding those constraints it breaks stuff. Another option is to increase the bottom padding and then reduce it when the keyboard becomes the first responder |
|
I don't like any of this to be honest lol. Supporting the iPhone Notch is low priority to me this weekend :/ Sent with GitHawk |
|
@nathantannar4 @SD10 Try this: If you change the line 280 on The change would be to pin the lower subview of MessageInputBar to |
|
Anything new about this? I could check it more in detail |
|
@etoledom Be my guest 👍 To be honest, I haven't read through everything here in great detail. Other more pressing issues taking precedence |

TODO:
Would solve #207
Not sure if this is expected behavior for inputAccessoryView. Looks like there is a radar here:
http://www.openradar.me/34411433
The view background color is set to the color of the
MessageInputBar