简体   繁体   English

按住表视图单元格上按钮的状态,在目标c中单击

[英]Hold the state of button on tableview cell click in objective c

I am working on table view cells .On each cell,there is a play button ..on click of that play button audio player plays audio and on double click of that button audio player pauses playing audio. 我正在处理表格视图单元格。在每个单元格上,都有一个播放按钮..单击该播放按钮时,音频播放器将播放音频,而双击该按钮时,音频播放器将暂停播放音频。 Suppose now when I click button1 on cell1 ,it turns to play on one click and pause on other click.Now its state is pause. 现在假设当我单击单元格1上的button1时,它变为单击一次播放并暂停其他单击。现在其状态为暂停。

Now ,when I click button2 on cell2 ,it turns to play on click1 and pause on other click.But the state of button1 also stays to pause whereas I want that on click of button2 on cell2 ,it should get back to its original state .ie the play state. 现在,当我单击cell2上的button2时,它会在click1上播放并在其他单击上暂停。但是button1的状态也保持暂停,而我希望在cell2上单击button2时,它应该回到其原始状态。即播放状态。

Kindly help me to achieve this.I am trying to implement it first time.Any help or guidance in this direction would be highly appreciated.Thanks in advance! 请帮助我实现这一目标。我正在尝试第一次实现它。对此方向的任何帮助或指导将不胜感激。在此先感谢您!

Tableview cell needs to reload, better if you have state of button in array, every time you make a button action change state in state array & reload specific row cell; Tableview单元需要重新加载,如果您在阵列中具有按钮状态,则每次在状态阵列中执行按钮操作更改状态并重新加载特定的行单元时,情况都会更好; reloadRowsAtIndexPaths will help you in this regard. reloadRowsAtIndexPaths将在这方面为您提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM