2015-05-29 50 views

回答

0

你可能想試試這個CocoaControl,給你一個像iOS一樣的完整的消息UI。

我真的試圖找到動畫代碼,我實現了這一點(甚至沒有緊密的解決方案,我沒有找到此觀察的叫法):

- (void)finishSendingMessageAnimated:(BOOL)animated { 

    UITextView *textView = self.inputToolbar.contentView.textView; 
    textView.text = nil; 
    [textView.undoManager removeAllActions]; 

    [self.inputToolbar toggleSendButtonEnabled]; 

    [[NSNotificationCenter defaultCenter] postNotificationName:UITextViewTextDidChangeNotification object:textView]; 

    [self.collectionView.collectionViewLayout invalidateLayoutWithContext:[JSQMessagesCollectionViewFlowLayoutInvalidationContext context]]; 
    [self.collectionView reloadData]; 

    if (self.automaticallyScrollsToMostRecentMessage) { 
     [self scrollToBottomAnimated:animated]; 
    } 
} 

如果你真的想要達到的動畫你可能想檢查完整的Control,或者只是實現它。

https://github.com/jessesquires/JSQMessagesViewController

希望它能幫助!

相關問題