ios7新的平移手势回到导航堆栈中并不能清除tableview选择 [英] ios7 new pan gesture to go back in navigation stack does not clear tableview selection

查看:218
本文介绍了ios7新的平移手势回到导航堆栈中并不能清除tableview选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个类似Notes的应用程序:uitableviewcontroller通过将各个笔记推送到导航堆栈来显示它们。我决定使用ios7 Back按钮和随附的平移手势识别器。

I have a Notes-like app: uitableviewcontroller showing up individual notes by pushing them onto navigation stack). And I decided to use an ios7 Back button and a pan gesture recognizer coming with it.

我唯一的修改就是在推送详细视图控制器之前,通过将from-controller的navigationItem标题设置为空字符串来删除按钮中的文本,因为建议在 https://stackoverflow.com/questions / 18870128 / ios-7-navigation-bar-custom-back-button-without-title

My only modification is removing text from the button by setting navigationItem title of the from-controller to an empty string before pushing the detail-view-controller, as it is advised at https://stackoverflow.com/questions/18870128/ios-7-navigation-bar-custom-back-button-without-title

按钮本身工作正常,但是当我通过平移手势从我的笔记回到笔记表视图,不清理tableview选择!我刚刚过渡的音符行仍然显示为选定的一行。
任何想法在这里可能有什么问题?

The button itself works just fine, but when I am going back from my note to the notes table view by means of the pan gesture, tableview selection is not cleaned! The row of the note I've just transitioned from is still shown as a selected one. Any ideas what could be wrong here?

我检查了标准的Notes应用程序,它就像一个魅力。

I've checked the standard Notes app and it works like a charm.

推荐答案

这个答案确实帮助了我: https://stackoverflow.com/questions/897071/iphone-uitableview-cells-stay-selected

This answer did help me: https://stackoverflow.com/questions/897071/iphone-uitableview-cells-stay-selected

- (void) viewWillAppear:(BOOL)animated {
    [self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:animated];
    [super viewWillAppear:animated];
}

这篇关于ios7新的平移手势回到导航堆栈中并不能清除tableview选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆