ios - 聊天界面Cell中语音消息播放动画问题
伊谢尔伦
伊谢尔伦 2017-04-17 14:28:45
0
2
1097

在 Cell 中有一个播放语音的图片,点击之后用uiimage通过animationImages播放几张图片,但是当 Cell 滚出屏幕之外的时候,uiimage就不动了,不知是复用覆盖了还是怎么?求大神给个解决思路啊

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(2)
大家讲道理

Finally I know, this is what I did,

  • (void) playVoiceAnimation;//Play voice animation
  • (void) stopVoiceAnimation;
    The above two methods are written in the cell and are used to start and stop the picture animation. The Cell has a mark. When clicking the voice, use the block to return the Cell identifier (rowIdentifier, when creating the Cell, cell.rowIdentifier = indexPath.row;) and audio File path to Chat VC

Play the audio file after receiving it in the chat VC, and cache cell.rowIdentifier to _rowPlayVoiceAnimationIdentifier, and then traverse visibleCells. If the Cell identifier (row) is the same as the cached one, call the Cell playVoiceAnimation method
Called after audio playback ends, same as above, call Cell stopVoiceAnimation method

Handling when scrolling:
//When the cell is about to be displayed, if it is a Cell that is playing the recording file, then execute the Cell to play the recording animation
if (((ACChatTableViewCell *)cell).rowIdentifier == _rowPlayVoiceAnimationIdentifier) ​​{
[((ACChatTableViewCell *)cell) startVoiceAnimation];
}

It’s a bit messy! ! !

迷茫

Is there any demo for reference?
632582467@qq.com

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template