jsqmessageviewcontroller ios11工具栏 [英] jsqmessageviewcontroller ios11 toolbar
问题描述
我在iOS 11模拟器中尝试了 JSQMessageViewController
的快速示例。结果如下:截图
I have tried the swift example of JSQMessageViewController
inside iOS 11 simulator. Here is the result:screenshot
我尝试过使用安全区域边距并修改工具栏约束,但仍然没有区别。似乎工具栏在UIWindow之外(改为UITextEffectsWindow)。有什么解决方案吗?
I have tried using safe area margin and modify the toolbar constraint but there is still no difference. It seems that the toolbar is outside UIWindow (UITextEffectsWindow instead). Is there any solution?
推荐答案
伙计们我已经弄明白了!只需将以下代码放在JSQMessagesInputToolbar.m中即可。似乎inputtoolbar放在它自己的窗口中,你需要单独访问它的窗口。
Guys I have figured it out! Just put the following code in the JSQMessagesInputToolbar.m. It seems that the inputtoolbar is placed in its own window, you need to access its window separately.
-(void) didMoveToWindow{
[super didMoveToWindow];
if (@available(iOS 11.0, *)) {
[[self bottomAnchor] constraintLessThanOrEqualToSystemSpacingBelowAnchor:self.window.safeAreaLayoutGuide.bottomAnchor multiplier:1.0].active = YES;
}
}
这篇关于jsqmessageviewcontroller ios11工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!