From 5fa506f7cc018d85ce8461f5d1a42fc66aa9dbcf Mon Sep 17 00:00:00 2001 From: nixzhu Date: Tue, 1 Dec 2015 18:35:35 +0800 Subject: [PATCH] update keyboardMan.animateWhenKeyboardAppear consider subscribeView --- .../Conversation/ConversationViewController.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Yep/ViewControllers/Conversation/ConversationViewController.swift b/Yep/ViewControllers/Conversation/ConversationViewController.swift index 55bd6515..1f74c643 100644 --- a/Yep/ViewControllers/Conversation/ConversationViewController.swift +++ b/Yep/ViewControllers/Conversation/ConversationViewController.swift @@ -676,6 +676,8 @@ class ConversationViewController: BaseViewController { if let strongSelf = self { + let subscribeViewHeight = strongSelf.isSubscribeViewShowing ? SubscribeView.height : 0 + if strongSelf.messageToolbarBottomConstraint.constant > 0 { // 注意第一次要减去已经有的高度偏移 @@ -685,14 +687,14 @@ class ConversationViewController: BaseViewController { strongSelf.conversationCollectionView.contentOffset.y += keyboardHeightIncrement } - strongSelf.conversationCollectionView.contentInset.bottom = keyboardHeight + strongSelf.messageToolbar.frame.height + strongSelf.conversationCollectionView.contentInset.bottom = keyboardHeight + strongSelf.messageToolbar.frame.height + subscribeViewHeight strongSelf.messageToolbarBottomConstraint.constant = keyboardHeight strongSelf.view.layoutIfNeeded() } else { strongSelf.conversationCollectionView.contentOffset.y += keyboardHeightIncrement - strongSelf.conversationCollectionView.contentInset.bottom = keyboardHeight + strongSelf.messageToolbar.frame.height + strongSelf.conversationCollectionView.contentInset.bottom = keyboardHeight + strongSelf.messageToolbar.frame.height + subscribeViewHeight strongSelf.messageToolbarBottomConstraint.constant = keyboardHeight strongSelf.view.layoutIfNeeded()