ios7 new pan gesture to go back in navigation stac

2020-08-25 05:31发布

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.

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

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?

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

2条回答
姐就是有狂的资本
2楼-- · 2020-08-25 06:17

At least for the cases we were seeing this happen, it seems to be fixed in iOS 7.0.4. (We've actually noticed that a number of glitches with the back gesture have been fixed during the 7.0.x releases.)

查看更多
我命由我不由天
3楼-- · 2020-08-25 06:23

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];
}
查看更多
登录 后发表回答