如何使用第一响应程序在具有多个表视图的视图中最多仅保留一个单元格被选中?
我有一个滚动视图,其中有几个表视图作为子视图...... 假设我在其中一个子视图中选择了一个单元格。现在,当我从另一个视图中选择一个单元格时,我之前选择的单元格不应突出显示。 我该怎么做?我知道我可以使用第一响应者来执行此操作,但我不确定如何执行此操作。 有人能帮我解决这个问题吗?
谢谢
I have a scrollview which has several table views as sub views...
say that I have selected a cell in one of the sub views. Now when I select a cell from another view, the cell I selected previously should not be highlighted.
How do I do this? I know I can do this using the first responder, but I am not sure how to do it.
Would anyone be able to help me out in this?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自苹果界面指南:
我认为苹果不会批准突出显示一行的应用程序(正是因为这个原因,我有一个应用程序被拒绝)。您应该执行一个操作,然后立即取消突出显示它。在极少数情况下,您可以在显示相关视图时将其突出显示。
但是,如果存储所选的当前单元格,则可以在 tableview 上调用 -deselectRowAtIndexPath:animated: 来取消选择行。
From the apple interface guidlines:
I don't think apple will approve an app that leaves a row highlighted (I had an app reject for that very reason). You should perform an action and then immediately unhighlight it. In some rare cases you can leave it highlighted while showing a related view.
However, if you store the current cell you have selected, you can call -deselectRowAtIndexPath:animated: on the tableview to deselect a row.