开发者

Iphone: Autoscroll on selected indexPath in table

开发者 https://www.devze.com 2022-12-16 22:22 出处:网络
I`m开发者_JAVA百科 working with a tableview controller where new rows are added manually by the user on a secondary controller and then returning to the tableview with the new row highlighted.

I`m开发者_JAVA百科 working with a tableview controller where new rows are added manually by the user on a secondary controller and then returning to the tableview with the new row highlighted.

I am using the following to highlight the row:

[self.shoppingCartTableView selectRowAtIndexPath:self.selectedIndexPath
  animated:YES 
  scrollPosition:UITableViewScrollPositionMiddle];

The highlighting works, but it does not automatically scroll to the row. Am I doing something wrong, or is there another way to make it work as intended?


Works perfectly for me. I tried it in a test application and posted the code here: Sample App

0

精彩评论

暂无评论...
验证码 换一张
取 消