2017-07-31 76 views
0

我使用JSQMessagesViewController我聊天应用JSQMessage气泡会向下滚动。iOS的 - 当键盘模式切换

当我改变键盘输入模式(即键盘语言),气泡将由高度向下滚动并通过inputToolbar覆盖。

我发现这个问题也出现在JSQMessagesViewController斯威夫特示例应用程序。所以这可能是一个错误。

我试图使气泡滚动至底部时,键盘输入模式的变化,但没有奏效。所以我想这是因为collectionView's底部是inputToolbar下方。

任何人都可以帮助在这个问题上?谢谢。

ScreenShots

变更前: Before change keyboard mode

变更后: After change keyboard mode

回答

0

使用的CollectionView的方法scrollToItem

像 -

let itemIndex = <Your Desired Index> or array.count - 1 (for scroll down one cell) 
let indexPath = IndexPath(row: itemIndex, section: sectionIndex) 
collectionView.scrollToItem(at:indexPath,at:UICollectionViewScrollPosition.CenteredVertically, animated: true) 

我希望这会起作用! :)