         self.adjustCollectionViewWithViewHeight(self.moreMessageTypesViewHeightConstraintConstant, animationDuration: 0.3, animationCurveValue: 7, keyboard: false)
     }
 
+
     override func viewDidLayoutSubviews() {
         super.viewDidLayoutSubviews()
 


            // 先调整一下初次的 contentInset
            setConversaitonCollectionViewOriginalContentInset()
            
            //以前的方法不能保证边界情况滚到底部
            scrollToLastMessage()

            prepareTextInputView()
        }
        
        self.waverView.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height - self.messageToolbar.frame.size.height)
    }
    
    func scrollToLastMessage() {
        
        if displayedMessagesRange.length > 0 {
            
            let keyboardAndToolBarHeight = messageToolbarBottomConstraint.constant + CGRectGetHeight(messageToolbar.bounds)
            let navicationBarAndKeyboardAndToolBarHeight = keyboardAndToolBarHeight + 64.0
            
            let visableMessageFieldHeight = conversationCollectionView.frame.size.height - navicationBarAndKeyboardAndToolBarHeight
            let useableSpace = visableMessageFieldHeight - conversationCollectionView.contentSize.height

            if (useableSpace > 0) {
                return

            } else {
                self.conversationCollectionView.contentOffset.y = self.conversationCollectionView.contentSize.height - self.conversationCollectionView.frame.size.height + keyboardAndToolBarHeight
            }
        }
    }

        }
    }
    
    func recoverMessageToolBar() {
        // 尝试恢复 messageToolbar 的状态
        if let
            draft = conversation.draft,
